@@ -51,6 +51,10 @@ public static async Task MessageUpdated(DiscordClient client, MessageUpdatedEven
51
51
{
52
52
client . Logger . LogDebug ( "Got a message update event for {message} by {user}" , DiscordHelpers . MessageLink ( e . Message ) , e . Message . Author . Id ) ;
53
53
}
54
+
55
+ if ( e . Message . Channel . GuildId != Program . cfgjson . ServerID )
56
+ return ;
57
+
54
58
await MessageHandlerAsync ( client , e . Message , e . Channel , true ) ;
55
59
}
56
60
@@ -69,7 +73,10 @@ public static async Task MessageDeleted(DiscordClient client, MessageDeletedEven
69
73
{
70
74
client . Logger . LogDebug ( "Got a message delete event for {message} by {user}" , DiscordHelpers . MessageLink ( e . Message ) , e . Message . Author . Id ) ;
71
75
}
72
-
76
+
77
+ if ( e . Message . Channel . GuildId != Program . cfgjson . ServerID )
78
+ return ;
79
+
73
80
foreach ( var warning in await Program . redis . HashGetAllAsync ( "automaticWarnings" ) )
74
81
{
75
82
if ( JsonConvert . DeserializeObject < UserWarning > ( warning . Value ) . ContextMessageReference . MessageId == e . Message . Id )
@@ -116,6 +123,9 @@ public static async Task MessagesBulkDeleted(DiscordClient client, MessagesBulkD
116
123
}
117
124
}
118
125
126
+ if ( e . Messages [ 0 ] . Channel . GuildId != Program . cfgjson . ServerID )
127
+ return ;
128
+
119
129
if ( Program . cfgjson . EnablePersistentDb )
120
130
{
121
131
// log the bulk deleted messages
@@ -268,9 +278,9 @@ public static async Task MessageHandlerAsync(DiscordClient client, DiscordMessag
268
278
public static async Task MessageHandlerAsync ( DiscordClient client , MockDiscordMessage message , DiscordChannel channel , bool isAnEdit = false , bool limitFilters = false , bool wasAutoModBlock = false )
269
279
{
270
280
#region message logging fill to db
271
-
272
281
// If db support is enabled, and this message is not in an excluded channel, cache it
273
- if ( Program . cfgjson . EnablePersistentDb
282
+ if ( message . Channel . GuildId == Program . cfgjson . ServerID
283
+ && Program . cfgjson . EnablePersistentDb
274
284
&& ! Program . cfgjson . MessageLogExcludedChannels . Contains ( message . ChannelId )
275
285
&& ( message . Channel . ParentId is null || ! Program . cfgjson . MessageLogExcludedChannels . Contains ( ( ulong ) message . Channel . ParentId ) ) )
276
286
{
0 commit comments