基本的に、すべて正常に動作して起動しているように見えますが、何らかの理由でコマンドを呼び出すことができません。私は今、簡単に1時間見回し、例を見たりビデオを見たりしてきましたが、何が間違っているのか一生わかりません。以下のコード:
import discord
import asyncio
from discord.ext import commands
bot = commands.Bot(command_prefix = '-')
@bot.event
async def on_ready():
print('Logged in as')
print(bot.user.name)
print(bot.user.id)
print('------')
@bot.event
async def on_message(message):
if message.content.startswith('-debug'):
await message.channel.send('d')
@bot.command(pass_context=True)
async def ping(ctx):
await ctx.channel.send('Pong!')
@bot.command(pass_context=True)
async def add(ctx, *, arg):
await ctx.send(arg)
on_message にあるデバッグ出力は実際に機能して応答し、ボット全体が例外なく実行されますが、コマンドは呼び出されません。