async def hotreload(self, ctx): message = await ctx.send("Hot reloading...") importlib.reload(Reloader) for c in Reloader.components: importlib.reload(c) Emoji.initialize(self.bot) Logging.info("Reloading all cogs...") temp = [] for cog in self.bot.cogs: temp.append(cog) for cog in temp: self.bot.unload_extension(f"cogs.{cog}") Logging.info(f'{cog} has been unloaded.') self.bot.load_extension(f"cogs.{cog}") Logging.info(f'{cog} has been loaded.') await message.edit(content="Hot reload complete")
async def on_ready(self): if not self.loaded: Logging.BOT_LOG_CHANNEL = self.get_channel( Configuration.get_var("log_channel")) Emoji.initialize(self) for cog in Configuration.get_var("cogs"): try: self.load_extension("cogs." + cog) except Exception as e: await Utils.handle_exception(f"Failed to load cog {cog}", self, e) Logging.info("Cogs loaded") self.loop.create_task(self.keepDBalive()) self.loaded = True await Logging.bot_log("Journey bot surfing through the dunes!")
async def on_ready(self): Logging.info(f"Skybot... {'RECONNECT!' if self.loaded else 'STARTUP!'}") if self.loaded: Logging.info("Skybot reconnect") return Logging.BOT_LOG_CHANNEL = self.get_channel(Configuration.get_var("log_channel")) Emoji.initialize(self) for cog in Configuration.get_var("cogs"): try: self.load_extension("cogs." + cog) except Exception as e: await Utils.handle_exception(f"Failed to load cog {cog}", self, e) Logging.info("Cogs loaded") self.db_keepalive = self.loop.create_task(self.keepDBalive()) self.loaded = True await Logging.bot_log("Skybot soaring through the skies!")
async def on_ready(self): if self.loaded: Logging.info(f"{self.my_name} reconnect") return Logging.BOT_LOG_CHANNEL = self.get_channel( Configuration.get_var("log_channel")) Emoji.initialize(self) for cog in Configuration.get_var("cogs"): try: self.load_extension("cogs." + cog) except Exception as e: await Utils.handle_exception(f"Failed to load cog {cog}", self, e) Logging.info("Cogs loaded") self.db_keepalive = self.loop.create_task(self.keepDBalive()) self.loaded = True await Logging.bot_log(f"{self.my_name} has started. Time to bot!")