WorldTime/Commands/RequireGuildContextAttribute.cs
Noi 362d288424 Move commands into subdirectory, create base class
Base class created with potentially common properties from existing class
2023-01-14 17:50:51 -08:00

14 lines
570 B
C#

using Discord.Interactions;
namespace WorldTime.Commands;
/// <summary>
/// Implements the included precondition from Discord.Net, requiring a guild context while using our custom error message.
/// </summary>
class RequireGuildContextAttribute : RequireContextAttribute {
public const string Error = "Command not received within a guild context.";
public const string Reply = ":x: This command is only available within a server.";
public override string ErrorMessage => Error;
public RequireGuildContextAttribute() : base(ContextType.Guild) { }
}