1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 17:19:00 +03:00
Octobot/Boyfriend/Commands/Command.cs

31 lines
1.1 KiB
C#
Raw Normal View History

2022-05-14 16:12:24 +03:00
using System.Text;
using Discord.Commands;
namespace Boyfriend.Commands;
public abstract class Command {
2022-05-14 16:12:24 +03:00
public abstract string[] Aliases { get; }
public abstract int ArgsLengthRequired { get; }
public abstract Task Run(SocketCommandContext context, string[] args);
2022-05-14 16:12:24 +03:00
protected static void Output(ref StringBuilder message) {
CommandHandler.StackedReplyMessage.Append(message).AppendLine();
}
2022-05-14 16:12:24 +03:00
protected static void Success(string message, string userMention, bool sendPublicFeedback = false,
bool sendPrivateFeedback = true) {
CommandHandler.StackedReplyMessage.Append(":white_check_mark: ").AppendLine(message);
if (sendPrivateFeedback)
Utils.StackFeedback(ref message, ref userMention, sendPublicFeedback);
}
2022-05-14 16:12:24 +03:00
protected static void Warn(string message) {
CommandHandler.StackedReplyMessage.Append(":warning: ").AppendLine(message);
}
2022-05-14 16:12:24 +03:00
protected static void Error(string message, bool accessDenied) {
var symbol = accessDenied ? ":no_entry_sign: " : ":x: ";
CommandHandler.StackedReplyMessage.Append(symbol).AppendLine(message);
}
}