Skip to content

Commit

Permalink
Remove code for autoban ID sets
Browse files Browse the repository at this point in the history
  • Loading branch information
Erisa committed Aug 19, 2024
1 parent 561c422 commit 89b2e68
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 41 deletions.
23 changes: 0 additions & 23 deletions Events/MemberEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,6 @@ public static async Task GuildMemberAdded(DiscordClient client, GuildMemberAdded
var _ = BanHelpers.BanSilently(e.Guild, e.Member.Id, "Secret sauce");
await LogChannelHelper.LogMessageAsync("investigations", $"{cfgjson.Emoji.Banned} Raid-banned {e.Member.Mention} for matching avatar: {e.Member.AvatarUrl.Replace("1024", "128")}");
}

string banDM = $"You have been automatically banned from **{e.Guild.Name}** for matching patterns of known raiders.\n" +
$"Please send an appeal and you will be unbanned as soon as possible: {cfgjson.AppealLink}\n" +
$"The requirements for appeal can be ignored in this case. Sorry for any inconvenience caused.";

foreach (var IdAutoBanSet in cfgjson.AutoBanIds)
{
if (db.HashExists(IdAutoBanSet.Name, e.Member.Id))
{
continue;
}

if (e.Member.Id > IdAutoBanSet.LowerBound && e.Member.Id < IdAutoBanSet.UpperBound)
{
await e.Member.SendMessageAsync(banDM);

await e.Member.BanAsync(TimeSpan.FromDays(7), "Matching patterns of known raiders, please unban if appealed.");

await LogChannelHelper.LogMessageAsync("investigations", $"{cfgjson.Emoji.Banned} Automatically appeal-banned {e.Member.Mention} for matching the creation date of the {IdAutoBanSet.Name} DM scam raiders.");
}

db.HashSet(IdAutoBanSet.Name, e.Member.Id, true);
}
}

// Restore user overrides stored in db (if there are any)
Expand Down
16 changes: 0 additions & 16 deletions Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ public class ConfigJson
[JsonProperty("modmailCategory")]
public ulong ModmailCategory { get; private set; }

[JsonProperty("autoBanIds")]
public List<AutoBanIdSet> AutoBanIds { get; private set; }

[JsonProperty("lineLimit")]
public int LineLimit { get; private set; }

Expand Down Expand Up @@ -346,19 +343,6 @@ public class WordListJson
[JsonProperty("channelId")]
public ulong? ChannelId { get; private set; }
}

public class AutoBanIdSet
{
[JsonProperty("name")]
public string Name { get; private set; }

[JsonProperty("upperBound")]
public ulong UpperBound { get; private set; }

[JsonProperty("lowerBound")]
public ulong LowerBound { get; private set; }
}

public class EmojiJson
{
[JsonProperty("noPermissions")]
Expand Down
2 changes: 0 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@
"giveaways": 1169336992455200820
},
"modmailCategory": 536572162450915340,
"autobanIds": [
],
"lineLimit": 30,
"increasedLineLimit": 1000,
"lineLimitTier": 3,
Expand Down

0 comments on commit 89b2e68

Please sign in to comment.