This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@commands.Cog.listener() | |
async def on_command_error(self, ctx, error): | |
if isinstance(error, commands.ConversionError): | |
pass | |
elif isinstance(error, commands.CheckFailure): | |
if isinstance(error, commands.PrivateMessageOnly): | |
pass | |
elif isinstance(error, commands.NoPrivateMessage): | |
pass | |
elif isinstance(error, commands.CheckAnyFailure): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sys | |
import traceback | |
import discord | |
from discord.ext import commands | |
from data.var import * | |
def translate_errors(_string: str): | |
eng_ita_error = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
from discord.ext import commands | |
from discord import app_commands, Interaction | |
from discord.app_commands import AppCommandError, Command, ContextMenu | |
from typing import Union | |
class COG_NAME(commands.Cog): | |
def __init__(self, bot): | |
self.bot = bot |