28 lines
1.4 KiB
C#
28 lines
1.4 KiB
C#
using System.Threading.Tasks;
|
|
using DSharpPlus.Entities;
|
|
using DSharpPlus.SlashCommands;
|
|
using DSharpPlus.SlashCommands.Attributes;
|
|
|
|
namespace SupportChild.Commands;
|
|
|
|
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();
|
|
|
|
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(), true)
|
|
.AddField("Open tickets:", openTickets + "", true)
|
|
.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);
|
|
}
|
|
}
|