Reputation: 178
I want my bot to send a file (not necessarily an image, could be a text file) to the channel when called. Here's my code snippet:
@bot.command(pass_context=True)
async def send(ctx):
area=ctx.message.channel
await bot.send_file(area, r"c:\location\of\the_file_to\send.png",content="Message test")
However, it gives me an error:
AttributeError: 'Bot' object has no attribute 'send_file'
I tried replacing send_file
with send
as another answer had suggested, but that didn't work either. What should be the correct syntax here?
Upvotes: 3
Views: 9651