示例#1
0
    async def choose(self, ctx, *args):
        full_options_str = " ".join(args)
        if "sabaton" in full_options_str.lower():
            await ctx.send(Storage.lang(self, 'choose_sabaton'))

        options = [i for i in full_options_str.split("|") if i.strip() != ""]
        if len(options) < 1:
            await ctx.send(Lang.lang(self, 'choose_noarg'))
            return
        result = random.choice(options)
        await ctx.send(Lang.lang(self, 'choose_msg') + result.strip())
示例#2
0
 async def bugscore_show(self, ctx):
     users = sorted(sorted(
         [(utils.get_best_username(
             discord.utils.get(self.bot.guild.members, id=user)), n)
          for (user, n) in self.storage["bugscore"].items()],
         key=lambda x: x[0].lower()),
                    key=lambda x: x[1],
                    reverse=True)
     lines = ["{}: {}".format(user, p) for (user, p) in users]
     for msg in utils.paginate(lines,
                               prefix="{}\n".format(
                                   Storage.lang(self, "bugscore_title"))):
         await ctx.send(msg)