Breadcraft-Support/Breadcraft/Commands/StatusCommand.cs

27 lines
1 KiB
C#
Raw Normal View History

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()
.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);
}
}