2023-01-26 03:42:11 -08:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using DSharpPlus.Entities;
|
|
|
|
|
using DSharpPlus.SlashCommands;
|
|
|
|
|
using DSharpPlus.SlashCommands.Attributes;
|
|
|
|
|
|
|
|
|
|
namespace Breadcraft.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()
|
2023-05-26 04:27:27 -07:00
|
|
|
|
.WithAuthor("BreadCraft-staff/Breadcraft-Support @ GitHub", "https://github.com/BreadCraft-staff/Breadcraft-Support", "https://cdn.discordapp.com/attachments/765441543100170271/905694651573489674/german_breadcraft.png")
|
|
|
|
|
.WithTitle("Bot information")
|
2023-01-26 03:42:11 -08:00
|
|
|
|
.WithColor(DiscordColor.Cyan)
|
|
|
|
|
.AddField("Version:", Breadcraft.GetVersion())
|
|
|
|
|
.AddField("Open tickets:", openTickets + "", true)
|
|
|
|
|
.AddField("Closed tickets:", closedTickets + " ", true);
|
|
|
|
|
await command.CreateResponseAsync(botInfo);
|
|
|
|
|
}
|
2023-05-26 04:27:27 -07:00
|
|
|
|
}
|