async def add_all_members(self, ctx): 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 members = ctx.guild.members count = 0 for member in members: member_dto = MemberDto() check_if_exists = member_dto.get_member(member.id) if check_if_exists is None: member_dto = MemberDto() member_dto.save_member(member.id) count += 1 await ctx.send(f'{count} members have been added to database')
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)