forked from TeamInklings/Octobot
Do not allow certain commands to be used in DMs (#49)
This PR prevents usage of `/about`, `/ping` and `/remind` inside DMs. While it may look like these commands do not require a guild attached to them, the language system depends on having a guild to fetch settings from, so it is not possible to use these commands in DMs. Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
parent
c6dd3727c3
commit
f75926c604
3 changed files with 11 additions and 1 deletions
|
@ -6,6 +6,7 @@ using Remora.Commands.Attributes;
|
|||
using Remora.Commands.Groups;
|
||||
using Remora.Discord.API.Abstractions.Rest;
|
||||
using Remora.Discord.Commands.Attributes;
|
||||
using Remora.Discord.Commands.Conditions;
|
||||
using Remora.Discord.Commands.Contexts;
|
||||
using Remora.Discord.Commands.Feedback.Services;
|
||||
using Remora.Discord.Extensions.Embeds;
|
||||
|
@ -40,8 +41,9 @@ public class RemindCommandGroup : CommandGroup {
|
|||
/// <param name="message">The text of the reminder.</param>
|
||||
/// <returns>A feedback sending result which may or may not have succeeded.</returns>
|
||||
[Command("remind")]
|
||||
[DiscordDefaultDMPermission(false)]
|
||||
[Description("Create a reminder")]
|
||||
[DiscordDefaultDMPermission(false)]
|
||||
[RequireContext(ChannelContext.Guild)]
|
||||
[UsedImplicitly]
|
||||
public async Task<Result> AddReminderAsync(
|
||||
[Description("After what period of time mention the reminder")]
|
||||
|
|
Reference in a new issue