@page "/admin/system/discordbot"
@using Moonlight.App.Services.DiscordBot
@using Moonlight.Shared.Components.Navigations

@inject DiscordBotService DiscordBotService

@attribute [PermissionRequired(nameof(Permissions.AdminSysDiscordBot))]

<AdminSystemNavigation Index="6"/>

<div class="mt-3 card card-body">
    <WButton Text="Register commands"
             WorkingText="Working"
             CssClasses="btn-primary"
             OnClick="RegisterCommands">
    </WButton>

    <WButton Text="Void commands"
             WorkingText="Working"
             CssClasses="mt-3 btn-danger"
             OnClick="VoidCommands">
    </WButton>
</div>

@code
{
    //ToDo: Ole muss ins Bett gehen
    //ToDo: Bot Info Card with Name, Bot Avatar, (RichPresence) Game Status, Activity Status

    private async Task RegisterCommands()
    {
        await DiscordBotService.CreateCommands();
    }

    private Task VoidCommands()
    {
        DiscordBotService.RemoveCommandsModule.VoidCommands();
        return Task.CompletedTask;
    }
}