Exemplo n.º 1
0
    async def save(self, ctx, *, tag):
        '''Saves a Clash Royale tag to your discord profile.

        Ability to save multiple tags coming soon.
        '''
        tag = self.conv.resolve_tag(tag)

        if not tag:
            raise InvalidTag('Invalid tag')

        ctx.save_tag(tag, 'clashroyale')

        await ctx.send('Successfuly saved tag.')
Exemplo n.º 2
0
    async def convert(self, ctx, argument):
        # Try to convert it to a member.
        try:
            user = await super().convert(ctx, argument)
        except commands.BadArgument:
            pass
        else:
            return user

        # Not a user so its a tag.
        tag = self.resolve_tag(argument)

        if not tag:
            raise InvalidTag('Invalid cr-tag passed.')
        else:
            return tag
Exemplo n.º 3
0
 async def convert(self, ctx, argument):
     tag = self.resolve_tag(argument)
     if not tag:
         raise InvalidTag('Invalid tag passed')
     else:
         return tag