lunarflu HF Staff commited on
Commit
bb10f07
·
verified ·
1 Parent(s): a3b8700

test track voice channel text chats

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -619,13 +619,16 @@ async def on_ready():
619
  guild = bot.get_guild(1346208250995015754)
620
 
621
 
622
- for channel in guild.text_channels: # helps with more accurate logging across restarts
623
- try:
624
- message_cache.update({m.id: m async for m in channel.history(limit=10000)})
625
- print(f"Finished caching messages for channel: {channel.name}")
626
- except Exception as e:
627
- print(f"An error occurred while fetching messages from {channel.name}: {e}")
628
- await asyncio.sleep(0.1)
 
 
 
629
 
630
 
631
  def run_bot():
 
619
  guild = bot.get_guild(1346208250995015754)
620
 
621
 
622
+ #for channel in guild.text_channels: # helps with more accurate logging across restarts
623
+
624
+ for channel in guild.channels:
625
+ if isinstance(channel, (discord.TextChannel, discord.Thread, discord.VoiceChannel)):
626
+ try:
627
+ message_cache.update({m.id: m async for m in channel.history(limit=10000)})
628
+ print(f"Finished caching messages for channel: {channel.name}")
629
+ except Exception as e:
630
+ print(f"An error occurred while fetching messages from {channel.name}: {e}")
631
+ await asyncio.sleep(0.1)
632
 
633
 
634
  def run_bot():