async def on_ready(self): Logger.info(f'Kasier loaded in {time() - Kaiser.started_at} seconds')
@classmethod async def on_command_error(self, ctx: Context, error: CommandError): if isinstance(error, CommandNotFound): return await KaiserModule.send_error( ctx, 'Command Not Found', f'The command you tried to run ({ctx.message.content}), does not exist' ) # TODO: More comprehensive list of errors and proper handlers Logger.warning(f'Unhandled error type {type(error)}') await KaiserModule.send_error(ctx) if __name__ == '__main__': Kaiser.started_at = time() Logger.info('Starting...') argparser = ArgumentParser(description=Kaiser.description) argparser.add_argument('-o', '--outfile', help='the log file to output to', dest='logfile', type=str, default=None) argparser.add_argument('-d', '--datafile', help='the database json file to use', dest='database', type=str, default=None) args = argparser.parse_args()
def load_module(self, module_init: Callable): module = module_init(self) Logger.info(f'Loading module {module.name}...') self.add_cog(module_init(self))
def cog_unload(self): Logger.info(f'Unloading module {self.name}')