我有一个简单的问题不和谐.py设置尝试使用.ping,但在当前实例中,实际发送“.ping”将导致bot不发送任何内容。有什么我不知道的吗?你知道吗
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix = ".")
@bot.event
async def on_ready():
print("Everything's all ready to go~")
@bot.event
async def on_message(message):
author = message.author
content = message.content
print(content)
@bot.event
async def on_message_delete(message):
author = message.author
channel = message.channel
await bot.send_message(channel, message.content)
@bot.command()
async def ping():
await bot.say('Pong!')
bot.run('Token')
确保在
on_message
事件中有await bot.process_commands(message)
。你知道吗https://discordpy.readthedocs.io/en/latest/faq.html#why-does-on-message-make-my-commands-stop-working
相关问题 更多 >
编程相关推荐