def __init__(self, bot_class, *args, **kwargs):
self.bot_class = bot_class
self.chat_ids = {}
self.shards = {}
self.extensions = {}
self.shard_tasks = {}
self.shard_connect_failures = {}
self.shard_count = 0
self.loop = asyncio.get_event_loop()
self.config = self._read_config("config.json")
self.credentials = self._read_config("credentials.json")
self.description = kwargs.pop("description", "\nHsss! Checkout the support command the join the official server!\n")
self.pm_help = kwargs.pop("pm_help", False)
self.help_attrs = kwargs.pop("help_attrs", dict(hidden=True))
self.command_not_found = kwargs.pop("command_not_found", "\N{WARNING SIGN} Whoops, '{}' doesn't exist!")
self.command_has_no_subcommands = kwargs.pop("command_has_no_subcommands", "\N{WARNING SIGN} Sorry, '{0.name}' doesn't have '{1}'")
self.invite_url = "https://discord.gg/qC4ancm"
self.kwargs = kwargs
self.args = args
self.kwargs.update({
"description": self.description,
"pm_help": self.pm_help,
"help_attrs": self.help_attrs,
"command_not_found": self.command_not_found,
"command_has_no_subcommands": self.command_has_no_subcommands,
"shard_count": self.shard_count
})
self.log = logging.getLogger()
self.log.setLevel(logging.DEBUG)
self.log.addHandler(
logging.FileHandler(filename="snake.log", encoding="utf-8", mode='w')
)
评论列表
文章目录