小编Cyn*_*dez的帖子

允许 Discord Rewrite 机器人响应其他机器人

我有一个 Discord bot 和一个用于 Discord 频道的 webhook 设置,可以每小时在点上发送一个命令。然而,默认情况下,Discord Rewrite 似乎忽略了从其他机器人发送的命令。我该如何禁用此功能?

我是否需要修改 per-command 函数或 on_message 函数上的某些内容?

当前消息

@bot.event
async def on_message(message):
    await bot.process_commands(message)
Run Code Online (Sandbox Code Playgroud)

编辑:找到解决方案

@bot.event
async def on_message(message):
    ctx = await bot.get_context(message)
    await bot.invoke(ctx)
Run Code Online (Sandbox Code Playgroud)

python discord discord.py-rewrite

6
推荐指数
1
解决办法
1847
查看次数

标签 统计

discord ×1

discord.py-rewrite ×1

python ×1