Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -256,9 +256,13 @@ async def top_gradio_threads(ctx, parent_id):
|
|
256 |
message_counts = {}
|
257 |
|
258 |
all_channels = await ctx.guild.fetch_channels()
|
259 |
-
|
260 |
-
|
261 |
-
|
|
|
|
|
|
|
|
|
262 |
print(f"Thread Name: {thread.name}, Thread ID: {thread.id}, Parent ID: {thread.parent_id}")
|
263 |
async for message in thread.history(limit=None):
|
264 |
message_counts[message.author] = message_counts.get(message.author, 0) + 1
|
|
|
256 |
message_counts = {}
|
257 |
|
258 |
all_channels = await ctx.guild.fetch_channels()
|
259 |
+
print(all_channels)
|
260 |
+
threads = [channel for channel in all_channels if isinstance(channel, discord.Thread)]
|
261 |
+
print(threads)
|
262 |
+
good_threads = [thread for thread in threads if thread.parent_id==parent_id]
|
263 |
+
print(good_threads)
|
264 |
+
|
265 |
+
for thread in good_threads:
|
266 |
print(f"Thread Name: {thread.name}, Thread ID: {thread.id}, Parent ID: {thread.parent_id}")
|
267 |
async for message in thread.history(limit=None):
|
268 |
message_counts[message.author] = message_counts.get(message.author, 0) + 1
|