【问题标题】:Discord bot not working and also not showing any errorsDiscord bot 不工作,也没有显示任何错误
【发布时间】:2020-12-26 20:30:42
【问题描述】:

我一直在尝试用 python 制作一个不和谐的机器人。我已经尝试了客户端 on_message 事件并发现了有关 discord.ext 的信息。我写了非常简单的代码,头疼了 4 个小时,仍然找不到问题所在。我知道的是代码成功连接到客户端,vscode 显示没有问题。机器人不会响应任何内容

代码是:

from discord.ext import commands

bot = commands.Bot(command_prefix='^')

@bot.command
async def test(ctx,arg):
     await ctx.send(arg)

client.run(token here)

【问题讨论】:

    标签: discord.py


    【解决方案1】:

    装饰器后面需要括号,改用@bot.command()

    【讨论】:

      猜你喜欢
      • 2021-07-24
      • 1970-01-01
      • 1970-01-01
      • 2018-06-08
      • 2016-06-28
      • 1970-01-01
      • 1970-01-01
      • 2013-05-21
      • 2023-02-08
      相关资源
      最近更新 更多