Skip to content

Commit

Permalink
Remove dead code for heartosoft restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Aug 19, 2024
1 parent f90fff8 commit 561c422
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
17 changes: 0 additions & 17 deletions Events/ReactionEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,13 @@ public static async Task OnReaction(DiscordClient _, MessageReactionAddedEventAr
if (e.Emoji.Id != cfgjson.HeartosoftId || e.Channel.IsPrivate || e.Guild.Id != cfgjson.ServerID)
return;

bool handled = false;

DiscordMessage targetMessage = await e.Channel.GetMessageAsync(e.Message.Id);

DiscordEmoji noHeartosoft = await e.Guild.GetEmojiAsync(cfgjson.NoHeartosoftId);

await Task.Delay(1000);

if (targetMessage.Author.Id == e.User.Id)
{
await targetMessage.DeleteReactionAsync(e.Emoji, e.User);
handled = true;
}

foreach (string word in cfgjson.RestrictedHeartosoftPhrases)
{
if (targetMessage.Content.ToLower().Contains(word))
{
if (!handled)
await targetMessage.DeleteReactionAsync(e.Emoji, e.User);

await targetMessage.CreateReactionAsync(noHeartosoft);
return;
}
}
}
}
Expand Down
6 changes: 0 additions & 6 deletions Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,6 @@ public class ConfigJson
[JsonProperty("heartosoftId")]
public ulong HeartosoftId { get; private set; }

[JsonProperty("noHeartosoftId")]
public ulong NoHeartosoftId { get; private set; }

[JsonProperty("restrictedHeartosoftPhrases")]
public List<string> RestrictedHeartosoftPhrases { get; private set; }

[JsonProperty("autoDehoistCharacters")]
public string AutoDehoistCharacters { get; private set; }

Expand Down
3 changes: 0 additions & 3 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,6 @@
984622268904779826
],
"heartosoftId": 413429915187281940,
"noHeartosoftId": 642508756189446165,
"restrictedHeartosoftPhrases": [
],
"autoDehoistCharacters": " !\"#$%&'()*+,-./:;<=>?@[\\]^_`'",
"secondaryAutoDehoistCharacters": "0123456789",
"hastebinEndpoint": "https://haste.erisa.uk",
Expand Down

0 comments on commit 561c422

Please sign in to comment.