fix: clean up some responders and commands
This commit is contained in:
parent
9e0e53a428
commit
6e45b0f5b5
4 changed files with 15 additions and 10 deletions
|
|
@ -39,9 +39,7 @@ public class ChannelCommands(
|
|||
[DiscordDefaultMemberPermissions(DiscordPermission.ManageGuild)]
|
||||
public async Task<IResult> ConfigureChannelsAsync()
|
||||
{
|
||||
if (contextInjection.Context is not IInteractionCommandContext ctx) throw new CataloggerError("No context");
|
||||
if (!ctx.TryGetUserID(out var userId)) throw new CataloggerError("No user ID in context");
|
||||
if (!ctx.TryGetGuildID(out var guildId)) throw new CataloggerError("No guild ID in context");
|
||||
var (userId, guildId) = contextInjection.GetUserAndGuild();
|
||||
if (!guildCache.TryGet(guildId, out var guild)) throw new CataloggerError("Guild not in cache");
|
||||
var guildChannels = channelCache.GuildChannels(guildId).ToList();
|
||||
var guildConfig = await db.GetGuildAsync(guildId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue