diff --git a/Commands/ConfigCommands.cs b/Commands/ConfigCommands.cs index 8b4dcb9..ccc1725 100644 --- a/Commands/ConfigCommands.cs +++ b/Commands/ConfigCommands.cs @@ -3,7 +3,7 @@ using Discord.Interactions; namespace WorldTime.Commands; [Group("config", "Configuration commands for World Time.")] [DefaultMemberPermissions(GuildPermission.ManageGuild)] -[EnabledInDm(false)] +[CommandContextType(InteractionContextType.Guild)] public class ConfigCommands : CommandsBase { internal const string HelpUse12 = "Sets whether to use the 12-hour (AM/PM) format in time zone listings."; internal const string HelpSetFor = "Sets/updates time zone for a given user."; diff --git a/Commands/UserCommands.cs b/Commands/UserCommands.cs index f0f4fa3..76a370c 100644 --- a/Commands/UserCommands.cs +++ b/Commands/UserCommands.cs @@ -23,6 +23,7 @@ public class UserCommands : CommandsBase { #endregion [SlashCommand("help", HelpHelp)] + [CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm)] public async Task CmdHelp() { var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version!.ToString(3); var guildct = ShardedClient.Guilds.Count; @@ -47,7 +48,7 @@ public class UserCommands : CommandsBase { } [SlashCommand("list", HelpList)] - [EnabledInDm(false)] + [CommandContextType(InteractionContextType.Guild)] public async Task CmdList([Summary(description: "A specific user whose time to look up.")]SocketGuildUser? user = null) { if (!await AreUsersDownloadedAsync(Context.Guild)) { await RespondAsync(ErrNoUserCache, ephemeral: true); @@ -149,7 +150,7 @@ public class UserCommands : CommandsBase { } [SlashCommand("set", HelpSet)] - [EnabledInDm(false)] + [CommandContextType(InteractionContextType.Guild)] public async Task CmdSet([Summary(description: "The new time zone to set.")]string zone) { var parsedzone = ParseTimeZone(zone); if (parsedzone == null) { @@ -164,7 +165,7 @@ public class UserCommands : CommandsBase { } [SlashCommand("remove", HelpRemove)] - [EnabledInDm(false)] + [CommandContextType(InteractionContextType.Guild)] public async Task CmdRemove() { using var db = DbContext; var success = db.DeleteUser((SocketGuildUser)Context.User);