def __init__(self): super().__init__(command_prefix=PazuChan.BOT_PREFIX, intents=intents) self.db = psycopg2.connect(os.getenv("DATABASE_URL"), sslmode="require") self.db.autocommit = True self.startup_time = datetime.now() self.last_updated_status = datetime.now() self.add_listener(self.on_ready) self.add_listener(self.on_command_error) # Override help command self.remove_command("help") # Cogs self.add_cog(Core(self)) self.add_cog(PuzzleHunt(self)) self.add_cog(Database(self)) self.add_cog(Trivia(self)) self.add_cog(Triplet(self)) self.add_cog(Layton(self)) self.add_cog(Cryptic(self)) self.add_cog(Chess(self))
async def on_command(self, ctx): self.command_count += 1 if __name__ == '__main__': # Get configuration from file with open('credentials.json') as f: file_dict = json.load(f) token = file_dict['token'] bungie_api_key = file_dict['d2-api-key'] bungie_client_id = file_dict['client-id'] bot = Spirit(token, bungie_api_key, bungie_client_id) # Add modules to bot bot.add_cog(Help(bot)) bot.add_cog(Core(bot)) bot.add_cog(Settings(bot)) bot.add_cog(Events(bot)) bot.add_cog(Register(bot)) bot.add_cog(General(bot)) bot.add_cog(Owner(bot)) bot.add_cog(Roster(bot)) bot.add_cog(Stats(bot)) bot.add_cog(Item(bot)) bot.add_cog(Loadout(bot)) bot.add_cog(Destiny(bot)) bot.run()