format.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:Aigis 作者: Joaquin-V 项目源码 文件源码
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:]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号