google.py 文件源码

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

项目:KeekoBot 作者: DavidNeon 项目源码 文件源码
def _googlesettings(self, ctx, maxresults: int=0):
        """Set the amount of results appearing"""

        if not self.maxresults:  # If statement incase someone removes it or sets it to 0
            self.maxresults = 3

        if maxresults == 0:
            message = box(
                "Current max search result is {}".format(self.maxresults))
            await send_cmd_help(ctx)
        elif maxresults > 10:
            await self.bot.say('`Cannot set max search results higher then 10`')
            return
        elif maxresults < 1:
            await self.bot.say('`Cannot set max search results lower then 0`')
            return
        else:
            self.maxresults = maxresults
            self.settings['MAXRESULTS'] = self.maxresults
            dataIO.save_json('data/google/settings.json', self.settings)
            message = '`Changed max search results to {} `'.format(
                self.maxresults)
        await self.bot.say(message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号