Norske-Nokkelsnikere / nokkelvokter-old

A work in progress Discord bot for use in CTFs
GNU General Public License v3.0
0 stars 0 forks source link

Can't export CTF due to insufficient permissions on json file #5

Closed fslaktern closed 1 year ago

fslaktern commented 1 year ago
2023-07-10 05:44:03,477:ERROR:bot: Exception in command export
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 229, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/bot/ctfs.py", line 191, in export
    await respond(ctx, ctf_model.export, ctx, ctx.author)
  File "/home/bot/ctfs.py", line 268, in respond
    for chan_id, msg in await callback(*args):
  File "/home/bot/ctf_model.py", line 911, in export
    return await save(guild, guild.name, main_chan.name, CTF)
  File "/home/bot/ctf_model.py", line 967, in save
    with open(json_file, "w") as w:
PermissionError: [Errno 13] Permission denied: 'backups/flab - wow.json'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 1349, in invoke
    await ctx.command.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1023, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 238, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: PermissionError: [Errno 13] Permission denied: 'backups/flab - wow.json'