lunarflu HF staff commited on
Commit
57d79b2
1 Parent(s): bb08ef2

member join, member remove

Browse files
Files changed (1) hide show
  1. app.py +33 -0
app.py CHANGED
@@ -210,6 +210,39 @@ async def on_member_unban(guild, unbanned_user):
210
 
211
  # admin stuff-----------------------------------------------------------------------------------------------------------------------
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  @bot.event
214
  async def on_guild_channel_create(channel):
215
  try:
 
210
 
211
  # admin stuff-----------------------------------------------------------------------------------------------------------------------
212
 
213
+
214
+ @bot.event
215
+ async def on_member_join(member):
216
+ try:
217
+ embed = Embed(color=Color.blue())
218
+ embed.set_author(name=f"{member} ID: {member.id}", icon_url=member.avatar.url)
219
+ embed.title = "User Joined"
220
+ embed.add_field(name="Mention", value=member.mention, inline=True)
221
+ embed.add_field(name="Nickname", value=member.nick, inline=True)
222
+ embed.add_field(name="Account Created At", value=member.created_at, inline=True)
223
+ embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
224
+ await bot.log_channel.send(embed=embed)
225
+
226
+ except Exception as e:
227
+ print(f"Error: {e}")
228
+
229
+
230
+ @bot.event
231
+ async def on_member_remove(member):
232
+ try:
233
+ embed = Embed(color=Color.blue())
234
+ embed.set_author(name=f"{member} ID: {member.id}", icon_url=member.avatar.url)
235
+ embed.title = "User Left"
236
+ embed.add_field(name="Mention", value=member.mention, inline=True)
237
+ embed.add_field(name="Nickname", value=member.nick, inline=True)
238
+ embed.add_field(name="Account Created At", value=member.created_at, inline=True)
239
+ embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
240
+ await bot.log_channel.send(embed=embed)
241
+
242
+ except Exception as e:
243
+ print(f"Error: {e}")
244
+
245
+
246
  @bot.event
247
  async def on_guild_channel_create(channel):
248
  try: