mirror of
https://github.com/NoiTheCat/BirthdayBot.git
synced 2024-11-21 13:54:36 +00:00
Use CommandContextType over deprecated EnabledInDm attributes
This commit is contained in:
parent
b3e9241235
commit
d94c98aed2
5 changed files with 5 additions and 5 deletions
|
@ -4,7 +4,7 @@ using System.Text;
|
||||||
|
|
||||||
namespace BirthdayBot.ApplicationCommands;
|
namespace BirthdayBot.ApplicationCommands;
|
||||||
[Group("birthday", HelpCmdBirthday)]
|
[Group("birthday", HelpCmdBirthday)]
|
||||||
[EnabledInDm(false)]
|
[CommandContextType(InteractionContextType.Guild)]
|
||||||
public class BirthdayModule : BotModuleBase {
|
public class BirthdayModule : BotModuleBase {
|
||||||
public const string HelpCmdBirthday = "Commands relating to birthdays.";
|
public const string HelpCmdBirthday = "Commands relating to birthdays.";
|
||||||
public const string HelpCmdSetDate = "Sets or updates your birthday.";
|
public const string HelpCmdSetDate = "Sets or updates your birthday.";
|
||||||
|
|
|
@ -5,7 +5,7 @@ using static BirthdayBot.Common;
|
||||||
namespace BirthdayBot.ApplicationCommands;
|
namespace BirthdayBot.ApplicationCommands;
|
||||||
[Group("override", HelpCmdOverride)]
|
[Group("override", HelpCmdOverride)]
|
||||||
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
|
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
|
||||||
[EnabledInDm(false)]
|
[CommandContextType(InteractionContextType.Guild)]
|
||||||
public class BirthdayOverrideModule : BotModuleBase {
|
public class BirthdayOverrideModule : BotModuleBase {
|
||||||
public const string HelpCmdOverride = "Commands to set options for other users.";
|
public const string HelpCmdOverride = "Commands to set options for other users.";
|
||||||
const string HelpOptOvTarget = "The user whose data to modify.";
|
const string HelpOptOvTarget = "The user whose data to modify.";
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Text;
|
||||||
namespace BirthdayBot.ApplicationCommands;
|
namespace BirthdayBot.ApplicationCommands;
|
||||||
[Group("config", HelpCmdConfig)]
|
[Group("config", HelpCmdConfig)]
|
||||||
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
|
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
|
||||||
[EnabledInDm(false)]
|
[CommandContextType(InteractionContextType.Guild)]
|
||||||
public class ConfigModule : BotModuleBase {
|
public class ConfigModule : BotModuleBase {
|
||||||
public const string HelpCmdConfig = "Configure basic settings for the bot.";
|
public const string HelpCmdConfig = "Configure basic settings for the bot.";
|
||||||
public const string HelpCmdAnnounce = "Settings regarding birthday announcements.";
|
public const string HelpCmdAnnounce = "Settings regarding birthday announcements.";
|
||||||
|
|
|
@ -7,7 +7,7 @@ public class ExportModule : BotModuleBase {
|
||||||
|
|
||||||
[SlashCommand("export-birthdays", HelpCmdExport)]
|
[SlashCommand("export-birthdays", HelpCmdExport)]
|
||||||
[DefaultMemberPermissions(GuildPermission.ManageGuild)]
|
[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) {
|
public async Task CmdExport([Summary(description: "Specify whether to export the list in CSV format.")] bool asCsv = false) {
|
||||||
if (!await HasMemberCacheAsync(Context.Guild)) {
|
if (!await HasMemberCacheAsync(Context.Guild)) {
|
||||||
await RespondAsync(MemberCacheEmptyError, ephemeral: true);
|
await RespondAsync(MemberCacheEmptyError, ephemeral: true);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
using Discord.Interactions;
|
using Discord.Interactions;
|
||||||
|
|
||||||
namespace BirthdayBot.ApplicationCommands;
|
namespace BirthdayBot.ApplicationCommands;
|
||||||
[EnabledInDm(true)]
|
[CommandContextType(InteractionContextType.Guild, InteractionContextType.BotDm)]
|
||||||
public class HelpModule : BotModuleBase {
|
public class HelpModule : BotModuleBase {
|
||||||
private const string TopMessage =
|
private const string TopMessage =
|
||||||
"Thank you for using Birthday Bot!\n" +
|
"Thank you for using Birthday Bot!\n" +
|
||||||
|
|
Loading…
Reference in a new issue