【发布时间】:2019-11-11 07:52:25
【问题描述】:
我最近创建了一个机器人,它只允许发送消息和阅读消息历史记录。在我自己的服务器中,该机器人似乎可以完美运行,但某个用户尝试在他自己的服务器上使用该机器人,并弹出错误discord.errors.Forbidden: 403 FORBIDDEN (error code: 50013): Missing Permissions。
await message.channel.send(file=discord.File(io.BytesIO(meme), filename="meme.png"))
上面的行是导致错误的原因。我认为我需要“附加文件”权限,但由于某种原因,它在我的测试服务器上没有它也可以工作。
完整的追溯:
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
【问题讨论】:
标签: python python-3.x discord.py