Skip to content

Commit 6938b9e

Browse files
committed
Exclude some channels and their threads from mention tracking
Fixes #256
1 parent 3c75a57 commit 6938b9e

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Events/MessageEvent.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public static async Task MessageHandlerAsync(DiscordClient client, MockDiscordMe
250250
if (channel.IsPrivate || channel.Guild.Id != Program.cfgjson.ServerID || message.Author.IsBot)
251251
return;
252252

253-
if (!limitFilters)
253+
if (!limitFilters && !Program.cfgjson.MentionTrackExcludedChannels.Contains(channel.Id) && (channel.ParentId is null || !Program.cfgjson.MentionTrackExcludedChannels.Contains((ulong)channel.ParentId)))
254254
{
255255
// track mentions
256256
if (message.MentionedUsers.Any(x => x.Id == Program.discord.CurrentUser.Id))

Structs.cs

+3
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ public class ConfigJson
307307

308308
[JsonProperty("rulesAllowedPublicChannels")]
309309
public List<ulong> RulesAllowedPublicChannels { get; private set; } = new();
310+
311+
[JsonProperty("mentionTrackExcludedChannels")]
312+
public List<ulong> MentionTrackExcludedChannels { get; private set; } = new();
310313
}
311314

312315
public enum Level { Information, Warning, Error, Debug, Verbose }

config.json

+5
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,10 @@
335335
740272437719072808,
336336
536572162450915340,
337337
355973419961155584
338+
],
339+
"mentionTrackExcludedChannels": [
340+
883400305679663156,
341+
593381041629298688,
342+
450181490345508884
338343
]
339344
}

0 commit comments

Comments
 (0)