def parse_command(self, prefixes = ['!']):
for prefix in prefixes:
if len(prefix) < len(self.text_cont) and self.text_cont.startswith(prefix):
print("Found a command with the {} prefix.".format(prefix))
self.comm_is = True
self.command = self.text_words[0][len(prefix):]
if len(self.text_words) > 1:
try:
self.comm_params = shlex.split(self.text_cont)[1:]
except ValueError:
self.comm_params = self.text_words[1:]
if self.chat_query and self.comm_is is False:
self.comm_is = True
self.command = self.text_words[0]
if len(self.text_words) > 1:
try:
self.comm_params = shlex.split(self.text_cont)[1:]
except ValueError:
self.comm_params = self.text_words[1:]
评论列表
文章目录