Answer the question
In order to leave comments, you need to log in
Problem with embed in discord.py. What to do?
I decided to write my python bot in discord using the discord.py library. Everything went fine, I made a few commands. The problem is the team is unbanned. It itself works correctly, but if you try to add it to embed, then nothing works, i.e. nothing is displayed and the person is not unbanned. Below is the code itself
@client.command()
@commands.has_permissions(ban_members = True)
async def unban(ctx, *, member=None):
if member is None:
await ctx.reply(f'Вы не указали участника!')
bans = await ctx.guild.bans()
member_name, member_discriminator = member.split("#")
for ban in bans:
user = ban.user
if(user.name, user.discriminator) == (member_name, member_discriminator):
await ctx.guild.unban(user)
# await ctx.send(f'Пользователь **{user}** был разбанен')
await ctx.send(embed = discord.Embed(title='**Модерация**', description = f"Пользователь **{user}** был разбанен\n"
f"Модератор: {ctx.author.mention} \n"))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question