async def run_bot(): log = logging.getLogger() try: pool = await Table.create_pool( config.postgresql, command_timeout=60, max_inactive_connection_lifetime=0, ) except Exception: click.echo("Could not set up PostgreSQL. Exiting.", file=sys.stderr) log.exception("Could not set up PostgreSQL. Exiting.") raise RuntimeError("Could not set up PostgreSQL. Exiting.") if pool is None: raise RuntimeError("Setting up PostgreSQL pool failed.") bot = Kukiko() bot.pool = pool await bot.start()
def setup(bot: Kukiko): bot.add_cog(RNG(bot))
def setup(bot: Kukiko): bot.add_cog(Fun(bot))
def setup(bot: Kukiko): bot.add_cog(Nihongo(bot))
def setup(bot: Kukiko): bot.add_cog(Help(bot))
def setup(bot: Kukiko): """Cog entrypoint.""" bot.add_cog(Admin(bot))
def setup(bot: Kukiko) -> None: bot.add_cog(MangaCog(bot))