[英]Issue sending file via Discord bot (Python)
if message.content.upper().startswith("!HEADPATS"):
time.sleep(1)
with open('tenor.gif', 'rb') as picture:
await client.send_file(channel, picture)
我已經啟動並運行了我的不和諧機器人(一切都是用 python 編寫的)。 我試圖讓機器人根據命令“!headpats”在頻道中發送 .gif。 文件已上傳並且代碼編譯正常,但是當通過 discord 調用 !headpats 命令時,編譯器將其吐出...
File "main.py", line 106, in on_message
await client.send_file(channel, picture)
NameError: name 'channel' is not defined
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.