A
A
A_Z-Z2021-10-06 11:15:30
Python
A_Z-Z, 2021-10-06 11:15:30

How to make the bot display the reason normally without _?

@bot.command()
@commands.has_permissions(administrator=True)
async def ban(ctx, member:discord.Member, reason):
    channel = bot.get_channel(894969274966368288)
    embed = discord.Embed( color=0xff0000, title='ban')
    embed.add_field(name='Модератор', value=ctx.message.author.mention)
    embed.add_field(name='Пользователь', value=member.mention)
    embed.add_field(name='Причина', value=reason)
    await member.ban()
    await ctx.send(embed=embed)
    await channel.send(embed=embed)


Here is the code

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Shandy, 2021-10-06
@A_Z-Z

Do it in this way:

async def ban(ctx, member:discord.Member, *, reason)

The command can be written like this:
!ban User причина бана
https://discordpy.readthedocs.io/en/stable/ext/com...

D
Dmitry Shitskov, 2021-10-06
@Zarom

async def ban(ctx, member:discord.Member, *reason):

And
embed.add_field(name='Причина', value=' '.join(reason))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question