Skip to content

Commit

Permalink
fix: ghost logging on remove listener
Browse files Browse the repository at this point in the history
  • Loading branch information
KnownBlackHat committed Apr 30, 2023
1 parent 0d5350c commit 459f321
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions Cogs/join_alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,27 @@ async def on_guild_join(self, guild):

@commands.Cog.listener()
async def on_guild_remove(self, guild):
embed = Embeds.emb(
Embeds.red,
guild.name,
f"""
Guild Id: {guild.id}
Owner Id: {guild.owner_id}
Vanity Invite Link: {guild.vanity_url_code}
Members Count: {guild.member_count}
""",
)
db.config.delete_one({"guild_id": guild.id})
db.traffic.delete_one({"guild_id": guild.id})
await send_webhook(
embed=embed,
webhook_url=os.getenv("whtraffic"),
username="Guild Leave Logger",
avatar_url="https://cdn.discordapp.com/avatars/10"
"87375480304451727/f780c7c8c052c66c89f9270aebd63b"
"c2.png?size=1024",
)
if guild.name:
embed = Embeds.emb(
Embeds.red,
guild.name,
f"""
Guild Id: {guild.id}
Owner Id: {guild.owner_id}
Vanity Invite Link: {guild.vanity_url_code}
Members Count: {guild.member_count}
""",
)
db.config.delete_one({"guild_id": guild.id})
db.traffic.delete_one({"guild_id": guild.id})
await send_webhook(
embed=embed,
webhook_url=os.getenv("whtraffic"),
username="Guild Leave Logger",
avatar_url="https://cdn.discordapp.com/avatars/10"
"87375480304451727/f780c7c8c052c66c89f9270aebd63b"
"c2.png?size=1024",
)


def setup(client: commands.Bot):
Expand Down

0 comments on commit 459f321

Please sign in to comment.