我试图让我的不和谐机器人向我的不和谐服务器发送一个 jpg 文件,但我不断收到一个错误,这似乎很不常见,因为我在互联网上找不到任何解决方案......
错误是... discord.ext.commands.errors.CommandInvokeError:命令引发异常:ClientRequestError:无法为https://discordapp.com/api/v6/channels/454374995758678029/messages编写请求正文
我的进口是
import time
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
Run Code Online (Sandbox Code Playgroud)
我将提取的与错误相关的代码是
@bot.command(pass_context = True)
async def image(ctx):
await bot.send_file(ctx.message.channel, open('halogen.jpg'))
Run Code Online (Sandbox Code Playgroud)
我只是缺少导入还是我的代码存在实际问题?
谢谢你们