Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
[HM] nickname testing
Browse files# nickname stuff
@bot
.event
async def on_member_update(before, after):
if before.name != after.name:
print(f"Username changed for {after.mention}: {before.name} -> {after.name}")
"""
embed = Embed(description=f"Username changed for {after.mention}: {before.name} -> {after.name}", color=Color.blue())
await bot.log_channel.send(embed=embed)
"""
if before.nick != after.nick:
print(f"Nickname changed for {after.mention}: {before.nick} -> {after.nick}")
if before.discriminator != after.discriminator:
print(f"Discriminator changed for {after.mention}: {before.discriminator} -> {after.discriminator}")
app.py
CHANGED
@@ -35,6 +35,14 @@ bot = commands.Bot(command_prefix='!', intents=intents)
|
|
35 |
# todo
|
36 |
'''
|
37 |
- test what works
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
- add role changes (moving roles)
|
39 |
|
40 |
discord.gg / discord/invite (block completely, need to be cautious)
|
@@ -106,9 +114,19 @@ async def on_message_delete(message):
|
|
106 |
# nickname stuff
|
107 |
@bot.event
|
108 |
async def on_member_update(before, after):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
if before.nick != after.nick:
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
112 |
|
113 |
@bot.event
|
114 |
async def on_member_ban(guild, user):
|
@@ -175,8 +193,6 @@ async def on_voice_state_update(member, before, after):
|
|
175 |
|
176 |
# bot stuff ---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
177 |
|
178 |
-
# send messages
|
179 |
-
#
|
180 |
|
181 |
@bot.event
|
182 |
async def on_ready():
|
@@ -184,7 +200,6 @@ async def on_ready():
|
|
184 |
bot.log_channel = bot.get_channel(1100458786826747945)
|
185 |
|
186 |
|
187 |
-
|
188 |
def run_bot():
|
189 |
bot.run(DISCORD_TOKEN)
|
190 |
|
|
|
35 |
# todo
|
36 |
'''
|
37 |
- test what works
|
38 |
+
->delete
|
39 |
+
->edit
|
40 |
+
|
41 |
+
|
42 |
+
-x>nicknames
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
- add role changes (moving roles)
|
47 |
|
48 |
discord.gg / discord/invite (block completely, need to be cautious)
|
|
|
114 |
# nickname stuff
|
115 |
@bot.event
|
116 |
async def on_member_update(before, after):
|
117 |
+
if before.name != after.name:
|
118 |
+
print(f"Username changed for {after.mention}: {before.name} -> {after.name}")
|
119 |
+
"""
|
120 |
+
embed = Embed(description=f"Username changed for {after.mention}: {before.name} -> {after.name}", color=Color.blue())
|
121 |
+
await bot.log_channel.send(embed=embed)
|
122 |
+
"""
|
123 |
+
|
124 |
if before.nick != after.nick:
|
125 |
+
print(f"Nickname changed for {after.mention}: {before.nick} -> {after.nick}")
|
126 |
+
|
127 |
+
if before.discriminator != after.discriminator:
|
128 |
+
print(f"Discriminator changed for {after.mention}: {before.discriminator} -> {after.discriminator}")
|
129 |
+
|
130 |
|
131 |
@bot.event
|
132 |
async def on_member_ban(guild, user):
|
|
|
193 |
|
194 |
# bot stuff ---------------------------------------------------------------------------------------------------------------------------------------------------------------
|
195 |
|
|
|
|
|
196 |
|
197 |
@bot.event
|
198 |
async def on_ready():
|
|
|
200 |
bot.log_channel = bot.get_channel(1100458786826747945)
|
201 |
|
202 |
|
|
|
203 |
def run_bot():
|
204 |
bot.run(DISCORD_TOKEN)
|
205 |
|