Z
Z
ZetZeter2022-04-20 07:45:11
Python
ZetZeter, 2022-04-20 07:45:11

How to ban a person with a space in their nickname?

I can't ban a person if there is a space in the nickname. Accepts only the first part of the nickname.
It just says user not found.

@bot.command( pass_context = True )
@commands.has_any_role( 966160872990965860, 966075529256116274, 966073485917040660 )                       
async def ban( ctx, member: discord.Member, *, reason = None ):
    await ctx.channel.purge( limit = 1 )
    await member.ban( reason = reason )
    await ctx.send( f'Забанен пользователь { member.mention }' )

625f96dac8846930620719.png625f96dfad7f8512234954.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2022-04-20
@ZetZeter

Nick in quotes

V
Vindicar, 2022-04-20
@Vindicar

Either put the nickname in quotes, or do mention instead of just a nickname, that works too.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question