refactor: return CataloggerError as Results instead of throwing in commands
This commit is contained in:
parent
84c3b42874
commit
8a4e3ff184
11 changed files with 57 additions and 36 deletions
|
|
@ -110,14 +110,14 @@ public partial class IgnoreMessageCommands : CommandGroup
|
|||
{
|
||||
var (userId, guildId) = contextInjection.GetUserAndGuild();
|
||||
if (!guildCache.TryGet(guildId, out var guild))
|
||||
throw new CataloggerError("Guild not in cache");
|
||||
return CataloggerError.Result("Guild not in cache");
|
||||
|
||||
var guildChannels = channelCache.GuildChannels(guildId).ToList();
|
||||
var guildConfig = await guildRepository.GetAsync(guildId);
|
||||
|
||||
var member = await memberCache.TryGetAsync(guildId, userId);
|
||||
if (member == null)
|
||||
throw new CataloggerError("Executing member not found");
|
||||
return CataloggerError.Result("Executing member not found");
|
||||
|
||||
var ignoredChannels = guildConfig
|
||||
.Messages.IgnoredChannels.Select(id =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue