Skip to content

Commit 027d13d

Browse files
committed
use a normal list for warns in the db
1 parent 91313df commit 027d13d

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

src/Bot/Systems/Commands/Interaction/Modules/Moderation/WarnCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public async Task<RuntimeResult> ClearWarnsAsync(
2828
SocketGuildUser member)
2929
{
3030
var gd = GetData();
31-
var warnCount = gd.Moderation.Warns.RemoveWhere(x => x.Target == member.Id);
31+
var warnCount = gd.Moderation.Warns.RemoveAll(x => x.Target == member.Id);
3232
Db.Save(gd);
3333

3434
var e = Context

src/Bot/Systems/Commands/Text/Modules/Moderation/WarnCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public async Task<ActionResult> ClearWarnsAsync(
4242
[Remainder, EnsureNotSelf, Description("The member who you want to clear warns for.")]
4343
SocketGuildUser member)
4444
{
45-
var warnCount = Context.GuildData.Moderation.Warns.RemoveWhere(x => x.Target == member.Id);
45+
var warnCount = Context.GuildData.Moderation.Warns.RemoveAll(x => x.Target == member.Id);
4646
Db.Save(Context.GuildData);
4747

4848
var e = Context

src/Bot/Systems/Database/EntitiesV2/GuildDataV2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public static GuildDataV2 CreateFrom(IGuild guild)
149149
Target = warnV1.User,
150150
Reason = warnV1.Reason,
151151
Date = warnV1.Date
152-
}).ToHashSet()
152+
}).ToList()
153153
},
154154
StarscriptTables = new StarscriptTables
155155
{

src/Bot/Systems/Database/EntitiesV2/ModerationData.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,5 @@ public class ModerationData
44
{
55
public ulong CurrentModActionCase { get; set; }
66

7-
public HashSet<WarnV2> Warns { get; set; }
8-
9-
public bool AddWarn(WarnInitializer warnInitializer)
10-
{
11-
var warn = new WarnV2();
12-
warnInitializer(warn);
13-
14-
return AddWarn(warn);
15-
}
16-
17-
public bool AddWarn(WarnV2 warn) => Warns.Add(warn);
7+
public List<WarnV2> Warns { get; set; }
188
}

0 commit comments

Comments
 (0)