lunarflu HF staff commited on
Commit
5e76531
1 Parent(s): 71c8455

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -29,7 +29,9 @@ async def save_messages(ctx, channel_id: int):
29
  await ctx.send("Channel not found.")
30
  return
31
 
32
- messages = await channel.history(limit=None).flatten()
 
 
33
 
34
  with open("gradio-questions.json", 'w', encoding='utf-8') as file:
35
  for message in messages:
 
29
  await ctx.send("Channel not found.")
30
  return
31
 
32
+ messages = []
33
+ async for message in channel.history(limit=None):
34
+ messages.append(message)
35
 
36
  with open("gradio-questions.json", 'w', encoding='utf-8') as file:
37
  for message in messages: