@@ -51,7 +51,7 @@ def log_message(arg_message):
51
51
author = arg_message .author
52
52
embed = discord .Embed (
53
53
title = "<:red_circle:1043616578744357085> Invite removed" ,
54
- description = f"Posted by { arg_message .author } \n In { arg_message .channel .mention } " ,
54
+ description = f"Posted by { arg_message .author } \n In { 'a DM.' if isinstance ( arg_message . channel , discord . DMChannel ) else arg_message .channel .mention } " ,
55
55
color = discord .Color .dark_red (),
56
56
timestamp = datetime .utcnow (),
57
57
)
@@ -70,8 +70,8 @@ def embed_warning(arg_message):
70
70
embed = discord .Embed (
71
71
title = "<:x:1055080113336762408> External Invites are not allowed here!" ,
72
72
description = f"{ arg_message .author } , your message was removed "
73
- f"because it contained an external invite.\n If this "
74
- f"was a mistake, contact the @staff" ,
73
+ f"because it contained an external invite.\n If this "
74
+ f"was a mistake, contact the @staff" ,
75
75
color = discord .Color .dark_red (),
76
76
timestamp = datetime .utcnow (),
77
77
)
@@ -87,6 +87,9 @@ def check_for_admin_override(arg_message):
87
87
return any (role .id in self .bot .server_settings .admin_roles .values () for role in message .author .roles )
88
88
89
89
if is_invite (txt ):
90
+ if isinstance (message .channel , discord .DMChannel ):
91
+ return
92
+
90
93
if not check_for_admin_override (txt ):
91
94
logs_channel = await self .bot .fetch_channel (self .bot .server_settings .log_channel ["mod_log" ])
92
95
await logs_channel .send (embed = log_message (message ))
0 commit comments