perf: 支持使用/开头的指令

This commit is contained in:
Soulter
2023-04-03 21:44:46 +08:00
parent 5b97fd2e6f
commit 291d3ebae8
4 changed files with 26 additions and 22 deletions
+7
View File
@@ -19,6 +19,13 @@ class Command:
return True, self.help()
return False, None
# 接受可变参数
def command_start_with(self, message: str, *args):
for arg in args:
if message.startswith(arg) or message.startswith('/'+arg):
return True
return False
def update(self, message: str):
l = message.split(" ")
if len(l) == 1: