SupportChild/Commands/StatusCommand.cs

31 lines
1.4 KiB
C#
Raw Normal View History

using System.ComponentModel;
using System.Threading.Tasks;
using DSharpPlus.Commands;
using DSharpPlus.Commands.ContextChecks;
using DSharpPlus.Commands.Processors.SlashCommands;
2022-02-21 08:40:09 +00:00
using DSharpPlus.Entities;
2022-08-21 07:34:11 +00:00
namespace SupportChild.Commands;
2022-02-21 08:40:09 +00:00
public class StatusCommand
2022-08-21 07:34:11 +00:00
{
[RequireGuild]
[Command("status")]
[Description("Shows bot status and information.")]
public async Task OnExecute(SlashCommandContext command)
{
long openTickets = Database.GetNumberOfTickets();
long closedTickets = Database.GetNumberOfClosedTickets();
2022-02-21 08:40:09 +00:00
DiscordEmbed botInfo = new DiscordEmbedBuilder()
.WithAuthor("Emotion-stuff/supportchild @ Toastielab", "https://toastielab.dev/Emotions-stuff/SupportChild", "https://cdn.discordapp.com/attachments/765441543100170271/914327948667011132/Ellie_Concept_2_transparent_ver.png")
.WithTitle("Bot information")
.WithColor(DiscordColor.Cyan)
2024-10-29 10:11:05 +00:00
.AddField("Version:", SupportChild.GetVersion(), true)
.AddField("Open tickets:", openTickets + "", true)
2024-10-29 10:11:05 +00:00
.AddField("Closed tickets:", closedTickets + " ", true)
.AddField("Report bugs:", "[Toastielab Issues](https://toastielab.dev/Emotions-stuff/SupportChild/issues)", true)
2024-12-27 05:06:25 +00:00
.AddField("Commands:", "[Toastielab Repository](https://toastielab.dev/Emotions-stuff/SupportChild/src/branch/main/docs/Commands.md)", true);
await command.RespondAsync(botInfo);
}
}