How to I import an image and use it to make a Discord bot?
So, I'm making a Discord bot and I want to make a bot that sends pictures of dragons when the user types "$dragon". So far, I have one image, and I have uploaded it to the Repl file tab. However, I don't know how to import the .gif file to my main.py file. Please help me! I'm very new to Python and coding as a whole...
Voters
Discord.py's send() method has an option for passing in files. Here's what it looks like:
As long as you have the channel that they sent the message through, this will send the image in the same channel.
@SixBeeps I tried it, and its showing undefined name 'channel'. Should I give the name of the channel or something? Thanks in advance!
@Nithen If you're using on_message, you can get the channel with message.channel. Is it possible for you to link the Repl?
@SixBeeps yea sure.. but it's very long
Go near the last line to find the error-
https://repl.it/@Nithen/Hawk#main.py