コード例 #1
0
ファイル: random.py プロジェクト: Misha12/rubbergod
 async def command_error(self, ctx, error):
     if isinstance(error, (commands.MissingRequiredArgument, commands.BadArgument)):
         await ctx.send(utils.get_command_signature(ctx))
     if isinstance(error, commands.CheckFailure):
         await ctx.message.channel.send(
             utils.fill_message("bot_room_redirect", user=ctx.message.author.id, bot_room=config.bot_room)
         )
コード例 #2
0
ファイル: config.py プロジェクト: solumath/rubbergod
 async def set_value(self, ctx, key=None, *value):
     """
     Dynamicaly change config values
     """
     if key is None or not value:
         await ctx.send(utils.get_command_signature(ctx))
         return
     await self.change_value(ctx, key, list(value), False)
コード例 #3
0
ファイル: config.py プロジェクト: solumath/rubbergod
 async def get(self, ctx, key=None):
     """
     Get value of specified key
     """
     if key is None:
         await ctx.send(utils.get_command_signature(ctx))
         return
     if not hasattr(Config, key) or key in Config.config_static:
         await ctx.send(Messages.config_wrong_key)
         return
     value = getattr(Config, key)
     embed = discord.Embed(title=key, description=str(value))
     await ctx.send(embed=embed)
コード例 #4
0
ファイル: random.py プロジェクト: Misha12/rubbergod
    async def pick(self, ctx, *args):
        """"Pick an option"""
        for i, arg in enumerate(args):
            if "?" in arg:
                args = args[i + 1:]
                break
        if not len(args):
            await ctx.send(utils.get_command_signature(ctx))
            return

        option = disnake.utils.escape_mentions(random.choice(args))
        if option:
            await ctx.send(f"{option} {ctx.author.mention}")