Answer the question
In order to leave comments, you need to log in
Is it possible to ban a member if they are not present on the server, discord.py?
It seems that I know that it is possible to ban a member if he is not present on the server, but my bot does not want to ban, even if the member is in the ban he does not want to ban once
Code
@bot.command()
@commands.has_permissions(ban_members = True)
async def ban(ctx, member: discord.Member, *, reason):
await member.ban(reason = reason)
await ctx.send(f"{member} был забронирован на сервере модератором {ctx.author}")
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "nutella" is not found
Ignoring exception in command ban:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
await ctx.command.invoke(ctx)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 855, in invoke
await self.prepare(ctx)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 789, in prepare
await self._parse_arguments(ctx)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 697, in _parse_arguments
transformed = await self.transform(ctx, param)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 552, in transform
return await self.do_conversion(ctx, converter, argument, param)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 505, in do_conversion
return await self._actual_conversion(ctx, converter, argument, param)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/core.py", line 451, in _actual_conversion
ret = await instance.convert(ctx, argument)
File "/data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 195, in convert
raise MemberNotFound(argument)
discord.ext.commands.errors.MemberNotFound: Member "898811322861506560" not found.
Answer the question
In order to leave comments, you need to log in
I am translating the error:
Member "898811322861506560" is not found
That is, no member - no blocking
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question