Closed trevor229 closed 7 years ago
It still throws the same error
sorry, I misread (was typing this while ingame), the file must the in the same dir you launched your script
await client.send_file(message.channel, open('fibCEus.gifv', 'rb'))
try that
Your command is expecting a message parameter, which you most likely never gave.
If you want to get the original message, you have to make the command pass the original context. See this link for reference: http://discordpy.readthedocs.io/en/latest/faq.html#how-do-i-get-the-original-message
working code
@client.command(pass_context = True)
async def butytho(ctxmessage):
await client.send_file(ctx.message.channel, 'fibCEus.gifv')
@client.command() #butytho
async def butytho(message):
await client.send_file(message.channel, 'fibCEus.gifv')
I'm trying to send the image in the same channel as the command was issued. I think the fix is obvious but I can't find it.
The error thrown is