SupportChild/Commands/StatusCommand.cs

29 lines
1.4 KiB
C#
Raw Permalink 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)
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)
.AddField("Commands:", "[Toastielab Repository](https://toastielab.dev/Emotions-stuff/SupportChild)", true);
await command.CreateResponseAsync(botInfo);
}
2022-12-25 11:21:51 +00:00
}