channel.py 文件源码

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

项目:telegram-autoposter 作者: vaniakosmos 项目源码 文件源码
def command_add(self, bot: Bot, update: Update, args: List[str]):
        usage_string = ('Nothing was added.\n'
                        'Usage: `/add <subreddit> <score_limit> [<subreddit> <score_limit>]*`')
        if len(args) == 0 or len(args) % 2 != 0:
            update.message.reply_text(usage_string, parse_mode=ParseMode.MARKDOWN)
            return

        subreddits = {}
        while args:
            name, score = args[:2]
            args = args[2:]
            if score.isdecimal():
                score = int(score)
            else:
                update.message.reply_text(usage_string)
                return
            subreddits[name] = score

        self.store.add(subreddits)
        self.command_list(bot, update)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号