use poise::{serenity_prelude::CreateEmbed, CreateReply};
use serde::{Deserialize, Serialize};

use crate::{
    consts::THEME_COLOR,
    utils::{footer, Extract, Recordable},
    Context, Error,
};

#[derive(Serialize, Deserialize, Extract)]
pub struct Options;

impl Recordable for Options {
    async fn run(self, ctx: Context<'_>) -> Result<(), Error> {
        let footer = footer(ctx);

        ctx.send(
            CreateReply::default().ephemeral(true).embed(
                CreateEmbed::new()
                    .title("Info")
                    .description(
                        "Help: `/help`

**Welcome to Reminder Bot!**
Developer: <@203532103185465344>
Icon: <@253202252821430272>
Find me on https://discord.jellywx.com and on https://github.com/JellyWX :)

Invite the bot: https://invite.reminder-bot.com/
Use our dashboard: https://reminder-bot.com/",
                    )
                    .footer(footer)
                    .color(*THEME_COLOR),
            ),
        )
        .await?;

        Ok(())
    }
}

/// Get information about the bot
#[poise::command(slash_command, rename = "info", identifying_name = "info")]
pub async fn command(ctx: Context<'_>) -> Result<(), Error> {
    (Options {}).run(ctx).await
}
