This file contains hidden or 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
export enum MongoErrorCode { | |
OK = 0, | |
InternalError = 1, | |
BadValue = 2, | |
OBSOLETE_DuplicateKey = 3, | |
NoSuchKey = 4, | |
GraphContainsCycle = 5, | |
HostUnreachable = 6,// Categories: NetworkError, RetriableError | |
HostNotFound = 7,// Categories: NetworkError, RetriableError | |
UnknownError = 8, |
This file contains hidden or 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
async def on_command_error(self, ctx, error): | |
# if command has local error handler, return | |
if hasattr(ctx.command, 'on_error'): | |
return | |
# get the original exception | |
error = getattr(error, 'original', error) | |
if isinstance(error, commands.CommandNotFound): | |
return |
This file contains hidden or 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 logging | |
import discord | |
from discord import app_commands | |
from discord.ext import commands | |
LOGGER: logging.Logger = logging.getLogger(__name__) | |