26 lines
1.1 KiB
C#
26 lines
1.1 KiB
C#
|
using System.Threading.Tasks;
|
|||
|
using DSharpPlus.Entities;
|
|||
|
using DSharpPlus.SlashCommands;
|
|||
|
using DSharpPlus.SlashCommands.Attributes;
|
|||
|
|
|||
|
namespace Valkyrie.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("Valkyriecoms/Valkyrie-support @ Toastielab", "https://toastielab.dev/Valkyriecoms/Valkyrie-support", "https://cdn.discordapp.com/attachments/1116306825390858343/1133619659371986964/Bygul_transparent_small.png")
|
|||
|
.WithTitle("Bot information")
|
|||
|
.WithColor(DiscordColor.Cyan)
|
|||
|
.AddField("Version:", Valkyrie.GetVersion())
|
|||
|
.AddField("Open tickets:", openTickets + "", true)
|
|||
|
.AddField("Closed tickets:", closedTickets + " ", true);
|
|||
|
await command.CreateResponseAsync(botInfo);
|
|||
|
}
|
|||
|
}
|