Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -152,14 +152,16 @@ async def on_member_update(before, after):
|
|
| 152 |
@bot.event
|
| 153 |
async def on_member_ban(guild, user):
|
| 154 |
try:
|
|
|
|
| 155 |
async for entry in guild.audit_logs(limit=5, action=discord.AuditLogAction.ban):
|
|
|
|
| 156 |
if entry.target == user:
|
| 157 |
-
|
| 158 |
account_age = datetime.utcnow() - user.created_at
|
| 159 |
created_and_age = f"{user.created_at} ({account_age})"
|
| 160 |
reason = f"Reason: {entry.reason}" if entry.reason else "No reason provided."
|
| 161 |
content = "<@&1108342563628404747>" # @alerts role
|
| 162 |
-
|
| 163 |
embed = Embed(color=Color.red())
|
| 164 |
embed.set_author(name=f"{user} ID: {user.id}", icon_url=user.avatar.url)
|
| 165 |
embed.title = "User Banned"
|
|
@@ -170,7 +172,8 @@ async def on_member_ban(guild, user):
|
|
| 170 |
embed.add_field(name="Nickname", value=entry.user.nick, inline=True)
|
| 171 |
embed.add_field(name="Reason", value=reason, inline=False)
|
| 172 |
embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
|
| 173 |
-
|
|
|
|
| 174 |
"""
|
| 175 |
# member banned from the guild
|
| 176 |
embed = Embed(description=f'Member {user.mention} was banned from the guild', color=Color.red())
|
|
@@ -288,7 +291,7 @@ async def check_github():
|
|
| 288 |
@bot.event
|
| 289 |
async def on_ready():
|
| 290 |
print('Logged on as', bot.user)
|
| 291 |
-
bot.test_channel = bot.get_channel(1100458786826747945) # bot-test
|
| 292 |
bot.log_channel = bot.get_channel(1036960509586587689) # admin-logs
|
| 293 |
|
| 294 |
|
|
|
|
| 152 |
@bot.event
|
| 153 |
async def on_member_ban(guild, user):
|
| 154 |
try:
|
| 155 |
+
print("1")
|
| 156 |
async for entry in guild.audit_logs(limit=5, action=discord.AuditLogAction.ban):
|
| 157 |
+
print("2")
|
| 158 |
if entry.target == user:
|
| 159 |
+
print("3")
|
| 160 |
account_age = datetime.utcnow() - user.created_at
|
| 161 |
created_and_age = f"{user.created_at} ({account_age})"
|
| 162 |
reason = f"Reason: {entry.reason}" if entry.reason else "No reason provided."
|
| 163 |
content = "<@&1108342563628404747>" # @alerts role
|
| 164 |
+
print("4")
|
| 165 |
embed = Embed(color=Color.red())
|
| 166 |
embed.set_author(name=f"{user} ID: {user.id}", icon_url=user.avatar.url)
|
| 167 |
embed.title = "User Banned"
|
|
|
|
| 172 |
embed.add_field(name="Nickname", value=entry.user.nick, inline=True)
|
| 173 |
embed.add_field(name="Reason", value=reason, inline=False)
|
| 174 |
embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
|
| 175 |
+
print("5")
|
| 176 |
+
await bot.log_channel.send(content=content, embed=embed)
|
| 177 |
"""
|
| 178 |
# member banned from the guild
|
| 179 |
embed = Embed(description=f'Member {user.mention} was banned from the guild', color=Color.red())
|
|
|
|
| 291 |
@bot.event
|
| 292 |
async def on_ready():
|
| 293 |
print('Logged on as', bot.user)
|
| 294 |
+
#bot.test_channel = bot.get_channel(1100458786826747945) # bot-test
|
| 295 |
bot.log_channel = bot.get_channel(1036960509586587689) # admin-logs
|
| 296 |
|
| 297 |
|