如何在Discord.py中使命令不区分大小写
发布于 2021-01-29 14:55:08
如何使命令不区分大小写,而不为不同的大小写添加许多别名,例如:
@bot.command(pass_context = True, name = 'test', aliases=['Test', 'tEst', 'teSt', 'tesT', 'TEst', 'TeSt', 'TesT', 'tESt', 'tEsT'])
async def test(self, ctx):
#do stuff
关注者
0
被浏览
114
1 个回答
-
在重写分支上,
commands.Bot
接受一个case_insensitive
参数bot = commands.Bot(command_prefix='!', case_insensitive=True)
请注意,使用此功能会降低性能。