def attentionseek(self, ctx: DogbotContext, replace_with='??'):
"""
Changes attention-seeking nicknames.
This will change the nickname of anybody whose name starts with "!"
to a name you specify. By default, they are renamed to "??".
The renaming of attention-seekers is borrowed from the Discord API
server.
"""
attention_seekers = [m for m in ctx.guild.members if m.display_name.startswith('!')]
succeeded = len(attention_seekers)
for seeker in attention_seekers:
try:
await seeker.edit(nick=replace_with)
except discord.HTTPException:
succeeded -= 1
failed_count = len(attention_seekers) - succeeded
await ctx.send(f'Renamed {succeeded} attention seeker(s). Failed to rename {failed_count}.')
评论列表
文章目录