SupportChild/Commands/StatusCommand.cs

27 lines
1.1 KiB
C#
Raw Normal View History

2022-04-18 10:52:03 +00:00
using System.Threading.Tasks;
2022-02-21 08:40:09 +00:00
using DSharpPlus.Entities;
2022-08-21 07:34:11 +00:00
using DSharpPlus.SlashCommands;
using DSharpPlus.SlashCommands.Attributes;
2022-02-21 08:40:09 +00:00
2022-08-21 07:34:11 +00:00
namespace SupportChild.Commands;
2022-02-21 08:40:09 +00:00
2022-08-21 07:34:11 +00:00
public class StatusCommand : ApplicationCommandModule
{
[SlashRequireGuild]
[SlashCommand("status", "Shows bot status and information.")]
public async Task OnExecute(InteractionContext 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)
.AddField("Version:", SupportChild.GetVersion())
.AddField("Open tickets:", openTickets + "", true)
.AddField("Closed tickets:", closedTickets + " ", true);
await command.CreateResponseAsync(botInfo);
}
2022-12-25 11:21:51 +00:00
}