Answer the question
In order to leave comments, you need to log in
How to make 2 pings via Discord py?
There is this code:
async def report(ctx, member: discord.Member, *, arg):
role = ctx.guild.get_role(999999999999) # Представьте, что 9999999 id роли модератора
members = ctx.guild.members
await ctx.channel.send('Your complaint was sent to moderators!', delete_after=10)
for member in members:
if role in member.roles:
await member.send(f'{ctx.author.mention} оставил жалобу на {member.mention} с причиной:\n**{arg}**')
await ctx.message.delete()
Answer the question
In order to leave comments, you need to log in
You pass the offender's name into a variable. member
Then, in a loop, overwrite the value of that variable with the name of the person with the moderator role
for member in members:
. Either do for user in users:
and , respectively await user.send
, or come up with a different parameter name for the offender.
In general, correct the variable names so that they do not intersect. To do this, it is worth making more explicit names of variables, the same member
definition has too general.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question