Please don’t rely on this Gitea instance being around forever. If any of your build scripts use my (kageru’s) projects hosted here, check my Github or IEW on Github for encoding projects. If you can’t find what you’re looking for there, tell me to migrate it.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.8 KiB

import traceback
import sys
from discord.ext import commands
import discord
import configloader
class ErrorHandler(commands.Cog):
def __init__(self, bot): = bot
async def on_command_error(self, ctx, error):
bot_app_info = await
ignore_error = (commands.CommandNotFound, commands.UserInputError)
if isinstance(error, ignore_error):
elif isinstance(error, commands.CommandOnCooldown):
embed = configloader.embed.messageEmbed(f"This command is ratelimited, please try again in",
f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
return await ctx.send(embed=embed)
elif isinstance(error, commands.NoPrivateMessage):
embed = configloader.embed.messageEmbed(f"This Command can't be used in Private Messages.",
f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
return await
elif isinstance(error, commands.MissingPermissions):
embed = configloader.embed.messageEmbed(f"You don't have Permissions to use this command",
f"{bot_app_info.owner}", f"{bot_app_info.icon_url}")
return await ctx.send(embed=embed)
def setup(bot):