I am making a Discord bot and trying to have it send images.
These are all my imports:
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import random
import time
import ftplib
Then I have this code:
bot = commands.Bot(command_prefix="2")
Then I have this one that when I launch my run.py it shows me some prints in the app:
@bot.event
async def on_ready():
print("I'm running on: " + bot.user.name)
print ("With the ID: " + (bot.user.id))
print("The commands are \n" + "#ping \n #pong \n #info (@user) \n #embedtest \n #hello \n #hug \n #kill \n ")
This is my code for the picture, so this code should make a picture pop up from the same folder as my run.py program is located.
@bot.command(pass_context=True)
async def image(ctx):
myImage = open('UDST.png', 'rb')
await bot.send_file(myImage)
But then when I run it, it gives me this error that I don't understand.
C:\Users\david>"C:\Users\david\Desktop\UDST Bot\Udst bot.py" File "C:\Users\david\Desktop\UDST Bot\Udst bot.py", line 105 await bot.send_file(myImage) ^ IndentationError: unindent does not match any outer indentation level
How do I resolve this error?