def get_kaa(self, env, start_response) -> Kaa: kaa = Kaa(env, start_response) kaa.register_resources('example.resources', 'Resources') kaa.register_filter_request('example.filters', 'OnRequest') kaa.register_filter_response('example.filters', 'OnResponse') kaa.register_filter_response('example.filters', 'EnableCors') return kaa
def main() -> None: load_dotenv() token = os.getenv('DISCORD_TOKEN') bot = Kaa() # required for dislash slash = SlashClient(bot) loop = asyncio.get_event_loop() loop.add_signal_handler(signal.SIGINT, lambda s=signal.SIGINT: asyncio.create_task( handle_sigint(s, loop, bot))) try: loop.run_until_complete(bot.start(token, bot=True, reconnect=True)) except: loop.run_until_complete(bot.close()) finally: loop.close()
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" bot.add_cog(Math(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" from ._cog import Python bot.add_cog(Python(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" bot.add_cog(Documentation(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" importlib.reload(_meme_generator) from ._cog import Memes bot.add_cog(Memes(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" importlib.reload(kaa_help) bot.add_cog(Help(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" bot.add_cog(CommandErrorHandler(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" from ._cog import Games bot.add_cog(Games(bot))
def setup(bot: Kaa) -> None: """function the bot uses to load this extension""" from ._cog import Code importlib.reload(_codeformatter) bot.add_cog(Code(bot))