lunarflu HF staff commited on
Commit
d8acdb0
1 Parent(s): c76f5d6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
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
- filtered_threads = [channel for channel in all_channels if isinstance(channel, discord.Thread) and channel.parent_id == parent_id]
260
-
261
- for thread in filtered_threads:
 
 
 
 
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