Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
test track voice channel text chats
Browse files
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 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
|
|
|
|
|
|
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():
|