add bot.fetch_error_channel
@@ -58,6 +58,10 @@ class VillagerBotShardGroup(commands.AutoShardedBot):
self.disabled_commands = {}
self.replies_cache = set()
+ # support server channels
+ self.error_channel = None
+ # self.dm_log_channel = None
+
# counters and other things
self.command_count = 0
self.message_count = 0
@@ -133,6 +137,12 @@ class VillagerBotShardGroup(commands.AutoShardedBot):
return self.l["en"]
+ async def fetch_error_channel(self): # needed to log errors from multiple shard groups
+ if self.error_channel is None:
+ self.error_channel = await self.fetch_channel(self.d.error_channel_id)
+
+ return self.error_channel
+
async def send_embed(self, location, message: str) -> None:
await location.send(embed=discord.Embed(color=self.d.cc, description=message))
