Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
updating on_member_ban (User does not allow the same options that Member does, so it changes if they leave before we create a log)
Browse files
app.py
CHANGED
@@ -180,7 +180,7 @@ async def on_member_update(before, after):
|
|
180 |
@bot.event
|
181 |
async def on_member_ban(guild, banned_user):
|
182 |
try:
|
183 |
-
await asyncio.sleep(
|
184 |
entry1 = await guild.fetch_ban(banned_user)
|
185 |
ban_reason = entry1.reason
|
186 |
print(f"ban_reason: {ban_reason}")
|
@@ -191,17 +191,14 @@ async def on_member_ban(guild, banned_user):
|
|
191 |
else:
|
192 |
print(f'{entry2.user} banned {entry2.target} (no reason specified)')
|
193 |
|
194 |
-
#ban_reason = f"Reason: {ban_reason}"
|
195 |
-
# HF 1108342563628404747
|
196 |
-
# test 1106995261487710411
|
197 |
content = "<@&1108342563628404747>" # @alerts role
|
198 |
embed = Embed(color=Color.red())
|
199 |
embed.set_author(name=f"{entry2.target} ID: {entry2.target.id}", icon_url=entry2.target.avatar.url if entry2.target.avatar else bot.user.avatar.url)
|
200 |
embed.title = "User Banned"
|
201 |
embed.add_field(name="User", value=entry2.target.mention, inline=True)
|
202 |
-
nickname = entry2.target.nick if entry2.target.nick else "None"
|
203 |
-
embed.add_field(name="Nickname", value=nicknmae, inline=True)
|
204 |
-
embed.add_field(name="Account Created At", value=entry2.target.created_at, inline=True)
|
205 |
embed.add_field(name="Moderator", value=entry2.user.mention, inline=True)
|
206 |
embed.add_field(name="Nickname", value=entry2.user.nick, inline=True)
|
207 |
embed.add_field(name="Reason", value=ban_reason, inline=False)
|
|
|
180 |
@bot.event
|
181 |
async def on_member_ban(guild, banned_user):
|
182 |
try:
|
183 |
+
await asyncio.sleep(1)
|
184 |
entry1 = await guild.fetch_ban(banned_user)
|
185 |
ban_reason = entry1.reason
|
186 |
print(f"ban_reason: {ban_reason}")
|
|
|
191 |
else:
|
192 |
print(f'{entry2.user} banned {entry2.target} (no reason specified)')
|
193 |
|
|
|
|
|
|
|
194 |
content = "<@&1108342563628404747>" # @alerts role
|
195 |
embed = Embed(color=Color.red())
|
196 |
embed.set_author(name=f"{entry2.target} ID: {entry2.target.id}", icon_url=entry2.target.avatar.url if entry2.target.avatar else bot.user.avatar.url)
|
197 |
embed.title = "User Banned"
|
198 |
embed.add_field(name="User", value=entry2.target.mention, inline=True)
|
199 |
+
#nickname = entry2.target.nick if entry2.target.nick else "None"
|
200 |
+
#embed.add_field(name="Nickname", value=nicknmae, inline=True)
|
201 |
+
#embed.add_field(name="Account Created At", value=entry2.target.created_at, inline=True)
|
202 |
embed.add_field(name="Moderator", value=entry2.user.mention, inline=True)
|
203 |
embed.add_field(name="Nickname", value=entry2.user.nick, inline=True)
|
204 |
embed.add_field(name="Reason", value=ban_reason, inline=False)
|