【问题标题】:Discord bot ignores lowercase commands [duplicate]Discord bot忽略小写命令[重复]
【发布时间】:2020-01-09 23:32:03
【问题描述】:

我的 Python 机器人用于 Discord 时遇到问题。例如,如果我输入!Hello,它就不起作用。

我必须输入!hello

代码如下:

@client.event
async def on_message(message):
if message.content.startswith("!hello"):
    `print(message.author.name)`
    embed = discord.Embed(color=0xFFCF20)
    embed.add_field(name="text", value="text", inline=False)
    embed.add_field(name="text:", value="text", inline=False)
    await message.author.send(embed=embed)`

【问题讨论】:

    标签: python discord discord.py


    【解决方案1】:
    if message.content.lower().startswith("!hello"):
    

    【讨论】:

      猜你喜欢
      • 2021-09-20
      • 2020-11-11
      • 2018-03-04
      • 1970-01-01
      • 1970-01-01
      • 2020-09-04
      • 1970-01-01
      • 2021-07-25
      • 2020-10-25
      相关资源
      最近更新 更多