Use CommandContextType over deprecated EnabledInDm attributes

This commit is contained in:
Noi 2024-04-28 19:45:51 -07:00
parent b3e9241235
commit d94c98aed2
5 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ using System.Text;
namespace BirthdayBot.ApplicationCommands;
[Group("birthday", HelpCmdBirthday)]
[EnabledInDm(false)]
[CommandContextType(InteractionContextType.Guild)]
public class BirthdayModule : BotModuleBase {
public const string HelpCmdBirthday = "Commands relating to birthdays.";
public const string HelpCmdSetDate = "Sets or updates your birthday.";

View file

@ -5,7 +5,7 @@ using static BirthdayBot.Common;
namespace BirthdayBot.ApplicationCommands;
[Group("override", HelpCmdOverride)]
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
[EnabledInDm(false)]
[CommandContextType(InteractionContextType.Guild)]
public class BirthdayOverrideModule : BotModuleBase {
public const string HelpCmdOverride = "Commands to set options for other users.";
const string HelpOptOvTarget = "The user whose data to modify.";

View file

@ -5,7 +5,7 @@ using System.Text;
namespace BirthdayBot.ApplicationCommands;
[Group("config", HelpCmdConfig)]
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
[EnabledInDm(false)]
[CommandContextType(InteractionContextType.Guild)]
public class ConfigModule : BotModuleBase {
public const string HelpCmdConfig = "Configure basic settings for the bot.";
public const string HelpCmdAnnounce = "Settings regarding birthday announcements.";

View file

@ -7,7 +7,7 @@ public class ExportModule : BotModuleBase {
[SlashCommand("export-birthdays", HelpCmdExport)]
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
[EnabledInDm(false)]
[CommandContextType(InteractionContextType.Guild)]
public async Task CmdExport([Summary(description: "Specify whether to export the list in CSV format.")] bool asCsv = false) {
if (!await HasMemberCacheAsync(Context.Guild)) {
await RespondAsync(MemberCacheEmptyError, ephemeral: true);

View file

@ -1,7 +1,7 @@
using Discord.Interactions;
namespace BirthdayBot.ApplicationCommands;
[EnabledInDm(true)]
[CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm)]
public class HelpModule : BotModuleBase {
private const string TopMessage =
"Thank you for using Birthday Bot!\n" +