lunarflu HF staff commited on
Commit
76423e6
1 Parent(s): 79a1edd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -46,7 +46,7 @@ async def save_messages(ctx, channel_id: int):
46
 
47
 
48
  @bot.command()
49
- async def save_forum(ctx, channel_id: int, file_name: str):
50
  channel = bot.get_channel(channel_id)
51
  if not channel:
52
  await ctx.send("Channel not found.")
@@ -60,7 +60,7 @@ async def save_forum(ctx, channel_id: int, file_name: str):
60
  threads[thread_id] = []
61
  threads[thread_id].append(message)
62
 
63
- with open(file_name, 'w', encoding='utf-8') as file:
64
  for thread_id, messages in threads.items():
65
  file.write(f"Thread ID: {thread_id}\n")
66
  for message in messages:
@@ -69,7 +69,7 @@ async def save_forum(ctx, channel_id: int, file_name: str):
69
 
70
  await ctx.send(f"Forum messages from {channel.name} saved to file")
71
 
72
- with open(file_name, 'rb') as file:
73
  discord_file = discord.File(file)
74
  await ctx.send(file=discord_file)
75
 
 
46
 
47
 
48
  @bot.command()
49
+ async def save_forum(ctx, channel_id: int):
50
  channel = bot.get_channel(channel_id)
51
  if not channel:
52
  await ctx.send("Channel not found.")
 
60
  threads[thread_id] = []
61
  threads[thread_id].append(message)
62
 
63
+ with open("gradio-questions.json", 'w', encoding='utf-8') as file:
64
  for thread_id, messages in threads.items():
65
  file.write(f"Thread ID: {thread_id}\n")
66
  for message in messages:
 
69
 
70
  await ctx.send(f"Forum messages from {channel.name} saved to file")
71
 
72
+ with open("gradio-questions.json", 'rb') as file:
73
  discord_file = discord.File(file)
74
  await ctx.send(file=discord_file)
75