'Discord py nickname, on_member_update
@bot.event
async def on_member_update(before, after):
if before == bannedwords:
await after.edit(nick=before.nick)
if before == bannedwords:
await after.edit(nick=before.nick)
else:
await after.edit(nick=before.nick)
print("old nick: ", before.nick)
print("new nick: ", after.nick)
My Code look like this.
My goal is to change the name whenever the nickname is changed, AND when it includes bad words.
for ex) /nick (cursing words) bot changes name into temporary name
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|


