Exemplo n.º 1
0
 async def xp(self, ctx):
     member_dto = MemberDto()
     member_dto.set_member(ctx.author.id)
     member_level = member_dto.get_member_level()
     level_name = member_level.name
     next_level = LevelDto()
     next_level = next_level.get_next_level(member_dto.total_xp)
     xp_needed = int(next_level.xp_amount - member_dto.total_xp)
     embed = Embed(
         title=f'{ctx.message.author.display_name}',
         description=
         f'Your level is: {level_name} and you have {member_dto.total_xp} XP. \n'
         f' XP needed until next level: {xp_needed}')
     await ctx.send(embed=embed)
Exemplo n.º 2
0
    async def add_member(self, ctx, member: Member):
        roles = ctx.author.roles
        role_ids = []
        for role in roles:
            role_ids.append(role.id)
        if GODMODE_ROLE_ID not in role_ids:
            await ctx.send('You do not have permission to use this command')
            return
        member_dto = MemberDto()
        member_dto.save_member(member.id)
        member_dto = member_dto.get_member(member.id)
        embed = Embed(title='Member added!')
        fields = [(self.bot.get_user(member_dto.member_id), member_dto.xp,
                   member_dto.get_member_level().name, False)]

        for name, xp, level, inline in fields:
            embed.add_field(name=f'Name: {name}',
                            value=f'XP: {xp} - Level: {level}',
                            inline=inline)

        await ctx.send(embed=embed)