如何使 discord bot 不区分大小写并同时收听 ping?
how to make discord bot be case insensitive and listen to pings same time?
client = commands.Bot(command_prefix=commands.when_mentioned_or['S!', 's!'], case_insensitive=True)
以上是我的代码,它只是给我一个错误:
Traceback (most recent call last):
File "main.py", line 28, in <module>
client = commands.Bot(command_prefix=commands.when_mentioned_or['S!', 's!'], case_insensitive=True)
TypeError: 'function' object is not subscriptable
KeyboardInterrupt
是
commands.when_mentioned_or(['S!', 's!'])
您必须像在任何其他函数中一样添加普通括号
bot = commands.Bot(command_prefix=commands.when_mentioned_or('s!'), case_insensitive=True)
client = commands.Bot(command_prefix=commands.when_mentioned_or['S!', 's!'], case_insensitive=True)
以上是我的代码,它只是给我一个错误:
Traceback (most recent call last):
File "main.py", line 28, in <module>
client = commands.Bot(command_prefix=commands.when_mentioned_or['S!', 's!'], case_insensitive=True)
TypeError: 'function' object is not subscriptable
KeyboardInterrupt
是
commands.when_mentioned_or(['S!', 's!'])
您必须像在任何其他函数中一样添加普通括号
bot = commands.Bot(command_prefix=commands.when_mentioned_or('s!'), case_insensitive=True)