-3
私はDiscordボットを作ってイメージを送信しようとしています。"IndentationError"を解決するにはどうすればよいですか?
これらはすべて私の輸入です:
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
import random
import time
import ftplib
その後、私はこのコードを持っている:
bot = commands.Bot(command_prefix="2")
その後、私は私が私のrun.pyを起動したとき、それは私の中にいくつかの印刷物を示していること、このいずれかを持っていますアプリ:
@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 ")
これは画像のコードなので、このコードは画像を同じ折り畳みからポップアップ表示する必要があります私のrun.pyプログラムがあるので。
@bot.command(pass_context=True)
async def image(ctx):
myImage = open('UDST.png', 'rb')
await bot.send_file(myImage)
しかし、それを実行すると、私はこのエラーを私には分かりません。
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
どのように私はこのエラーを解決するのですか?
SOに類似のスレッドがありますか? [ここ](https://stackoverflow.com/questions/492387/indentationerror-unindent-does-not-match-any-outer-indentation-level)と[ここ](https://stackoverflow.com/a/)を参照してください。 26720878/8881141) – MrT
インデントがないのはなぜですか? – Wright