feat: split ignores into 'ignore messages' and 'ignore entities'
This commit is contained in:
parent
d48ab7e16e
commit
0cac964aa6
32 changed files with 730 additions and 488 deletions
|
|
@ -37,7 +37,7 @@ public partial class GuildsController
|
|||
var guildConfig = await guildRepository.GetAsync(guildId);
|
||||
|
||||
var output = new List<IgnoredUser>();
|
||||
foreach (var userId in guildConfig.Channels.IgnoredUsers)
|
||||
foreach (var userId in guildConfig.Messages.IgnoredUsers)
|
||||
{
|
||||
if (cts.Token.IsCancellationRequested)
|
||||
break;
|
||||
|
|
@ -72,11 +72,11 @@ public partial class GuildsController
|
|||
if (user == null)
|
||||
throw new ApiError(HttpStatusCode.NotFound, ErrorCode.BadRequest, "User not found");
|
||||
|
||||
if (guildConfig.Channels.IgnoredUsers.Contains(user.ID.Value))
|
||||
if (guildConfig.Messages.IgnoredUsers.Contains(user.ID.Value))
|
||||
return Ok(new IgnoredUser(user.ID.Value, user.Tag()));
|
||||
|
||||
guildConfig.Channels.IgnoredUsers.Add(user.ID.Value);
|
||||
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig.Channels);
|
||||
guildConfig.Messages.IgnoredUsers.Add(user.ID.Value);
|
||||
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
|
||||
|
||||
return Ok(new IgnoredUser(user.ID.Value, user.Tag()));
|
||||
}
|
||||
|
|
@ -87,8 +87,8 @@ public partial class GuildsController
|
|||
var (guildId, _) = await ParseGuildAsync(id);
|
||||
var guildConfig = await guildRepository.GetAsync(guildId);
|
||||
|
||||
guildConfig.Channels.IgnoredUsers.Remove(userId);
|
||||
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig.Channels);
|
||||
guildConfig.Messages.IgnoredUsers.Remove(userId);
|
||||
await guildRepository.UpdateChannelConfigAsync(guildId, guildConfig);
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue