I've recently created a bot which is only allowed to send messages and read message history. In my own servers, the bot seemed to work flawlessly, but a certain user tried using the bot on his own server and the error discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions
popped up.
await message.channel.send(file=discord.File(io.BytesIO(meme), filename="meme.png"))
The line above is what's causing the error. I'm thinking that I need the 'Attach Files' permission, but for some reason it works without it on my testing servers.
Full traceback:
Traceback (most recent call last):
File "/home/nemplayer/.local/lib/python3.7/site-packages/discord/client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "bot/bot.py", line 78, in on_message
await message.channel.send(file=discord.File(io.BytesIO(meme), filename="meme.png"))
File "/home/nemplayer/.local/lib/python3.7/site-packages/discord/abc.py", line 806, in send
content=content, tts=tts, embed=embed, nonce=nonce)
File "/home/nemplayer/.local/lib/python3.7/site-packages/discord/http.py", line 218, in request
raise Forbidden(r, data)
discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…