import {
    ActionRowBuilder,
    AttachmentBuilder,
    ButtonBuilder,
    ButtonInteraction,
    ButtonStyle,
    ChannelType,
    CommandInteraction,
    ComponentType,
    Guild,
    GuildTextBasedChannel,
    ModalBuilder,
    ModalSubmitInteraction,
    TextInputBuilder,
    TextInputStyle
} from "discord.js";
import type { SlashCommandSubcommandBuilder } from "discord.js";
import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
import client from "../../utils/client.js";
import config from "../../config/main.js";

const command = (builder: SlashCommandSubcommandBuilder) =>
    builder.setName("stats").setDescription("Gets the bot's stats");

const confirm = async (interaction: ButtonInteraction) => {
    const requiredTexts = [
        "just do it",
        "yes, do as i say!",
        "clicksminuteper/nucleus",
        "i've said it once i'll say it again",
        "no, i've changed my mind",
        "this incident will be reported",
        "coded told me to",
        "mini told me to",
        "pinea told me to",
        "what's a java script",
        "it's a feature not a bug",
        "that never happened during testing"
    ];
    const chosen = requiredTexts[Math.floor(Math.random() * (requiredTexts.length - 1))]!;

    const modal = new ModalBuilder()
        .addComponents(
            new ActionRowBuilder<TextInputBuilder>().addComponents(
                new TextInputBuilder()
                    .setStyle(TextInputStyle.Short)
                    .setLabel(`Type "${chosen}" below`)
                    .setCustomId("confirm")
                    .setPlaceholder("Guild ID")
                    .setMinLength(chosen.length)
                    .setMaxLength(chosen.length)
            )
        )
        .setTitle("Admin Panel")
        .setCustomId("adminPanel");
    await interaction.showModal(modal);
    let out: ModalSubmitInteraction;
    try {
        out = await interaction.awaitModalSubmit({
            filter: (i) => i.customId === "adminPanel" && i.user.id === interaction.user.id,
            time: 300000
        });
    } catch {
        return;
    }
    await out.deferUpdate();
    const typed = out.fields.getTextInputValue("confirm");
    return typed.toLowerCase() === chosen.toLowerCase();
};

const callback = async (interaction: CommandInteraction): Promise<void> => {
    const description = `**Servers:** ${client.guilds.cache.size}\n` + `**Ping:** \`${client.ws.ping * 2}ms\``;
    const m = await interaction.reply({
        embeds: [
            new EmojiEmbed()
                .setTitle("Stats")
                .setDescription(description)
                .setStatus("Success")
                .setEmoji("SETTINGS.STATS.GREEN")
        ],
        ephemeral: true,
        fetchReply: true
    });
    if (config.owners.includes(interaction.user.id)) {
        await interaction.editReply({
            embeds: [
                new EmojiEmbed()
                    .setTitle("Admin")
                    .setDescription(description)
                    .setStatus("Success")
                    .setEmoji("SETTINGS.STATS.GREEN")
            ],
            components: [
                new ActionRowBuilder<ButtonBuilder>().addComponents(
                    new ButtonBuilder().setCustomId("admin").setLabel("Admin Panel").setStyle(ButtonStyle.Primary),
                    new ButtonBuilder()
                        .setCustomId("announce")
                        .setLabel("Announce to all Guilds")
                        .setStyle(ButtonStyle.Danger)
                )
            ]
        });

        const modal = new ModalBuilder()
            .addComponents(
                new ActionRowBuilder<TextInputBuilder>().addComponents(
                    new TextInputBuilder()
                        .setStyle(TextInputStyle.Short)
                        .setLabel("Guild ID")
                        .setCustomId("guildID")
                        .setPlaceholder("Guild ID")
                        .setMinLength(16)
                        .setMaxLength(25)
                )
            )
            .setTitle("Admin Panel")
            .setCustomId("adminPanel");
        let i1: ButtonInteraction;
        const channel = await client.channels.fetch(interaction.channelId);
        if (
            !channel ||
            [ChannelType.GuildCategory, ChannelType.GroupDM, ChannelType.GuildStageVoice].includes(channel.type)
        )
            return;
        // console.log(interaction)
        if (!("awaitMessageComponent" in channel)) return;
        let GuildID = interaction.guildId;
        try {
            i1 = await m.awaitMessageComponent<ComponentType.Button>({
                filter: (i) => i.user.id === interaction.user.id,
                time: 300000
            });
        } catch (e) {
            console.log(e);
            return;
        }
        switch (i1.customId) {
            case "admin": {
                if (!GuildID) {
                    await i1.showModal(modal);
                    let out: ModalSubmitInteraction;
                    try {
                        out = await i1.awaitModalSubmit({
                            filter: (i) => i.customId === "adminPanel" && i.user.id === interaction.user.id,
                            time: 300000
                        });
                    } catch {
                        return;
                    }
                    await out.deferUpdate();
                    GuildID = out.fields.getTextInputValue("guildID");
                } else if (!client.guilds.cache.has(GuildID)) {
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed().setTitle("Admin").setDescription("Not in server").setStatus("Danger")
                        ],
                        components: []
                    });
                }

                await interaction.editReply({
                    embeds: [],
                    components: [
                        new ActionRowBuilder<ButtonBuilder>().addComponents(
                            new ButtonBuilder().setCustomId("stats").setLabel("Stats").setStyle(ButtonStyle.Primary),
                            new ButtonBuilder()
                                .setCustomId("data")
                                .setLabel("Guild data")
                                .setStyle(ButtonStyle.Secondary),
                            new ButtonBuilder()
                                .setCustomId("cache")
                                .setLabel("Reset cache")
                                .setStyle(ButtonStyle.Success),
                            new ButtonBuilder().setCustomId("leave").setLabel("Leave").setStyle(ButtonStyle.Danger),
                            new ButtonBuilder()
                                .setCustomId("purge")
                                .setLabel("Delete data")
                                .setStyle(ButtonStyle.Danger)
                        )
                    ]
                });
                let i;
                try {
                    i = await m.awaitMessageComponent<ComponentType.Button>({
                        filter: (i) => i.user.id === interaction.user.id && i.message.id === m.id,
                        time: 300000
                    });
                } catch {
                    return;
                }
                const guild = (await client.guilds.fetch(GuildID)) as Guild | null;
                if (!guild) {
                    await i.deferUpdate();
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed().setTitle("Admin").setDescription("Not in server").setStatus("Danger")
                        ],
                        components: []
                    });
                    return;
                }
                if (i.customId === "stats") {
                    await i.deferUpdate();
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Stats")
                                .setDescription(
                                    `**Name:** ${guild.name}\n` +
                                        `**ID:** \`${guild.id}\`\n` +
                                        `**Owner:** ${client.users.cache.get(guild.ownerId)!.tag}\n` +
                                        `**Member Count:** ${guild.memberCount}\n` +
                                        `**Created:** <t:${guild.createdTimestamp}:F>\n` +
                                        `**Added Nucleus:** <t:${guild.members.me!.joinedTimestamp}:R>\n` +
                                        `**Nucleus' Perms:** https://discordapi.com/permissions.html#${guild.members.me!.permissions.valueOf()}\n`
                                )
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ]
                    });
                } else if (i.customId === "leave") {
                    if (!(await confirm(i))) {
                        await interaction.editReply({
                            embeds: [new EmojiEmbed().setTitle("No changes were made").setStatus("Danger")],
                            components: []
                        });
                        return;
                    }
                    await guild.leave();
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Left")
                                .setDescription(`Left ${guild.name}`)
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ],
                        components: []
                    });
                } else if (i.customId === "data") {
                    await i.deferUpdate();
                    // Get all the data and convert to a string
                    const data = await client.database.guilds.read(guild.id);
                    const stringified = JSON.stringify(data, null, 2);
                    const buffer = Buffer.from(stringified);
                    const attachment = new AttachmentBuilder(buffer).setName("data.json");
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Data")
                                .setDescription(`Data for ${guild.name}`)
                                .setStatus("Success")
                        ],
                        components: [],
                        files: [attachment]
                    });
                } else if (i.customId === "purge") {
                    if (!(await confirm(i))) {
                        await interaction.editReply({
                            embeds: [new EmojiEmbed().setTitle("No changes were made").setStatus("Danger")],
                            components: []
                        });
                        return;
                    }
                    await client.database.guilds.delete(GuildID);
                    await client.database.history.delete(GuildID);
                    await client.database.notes.delete(GuildID);
                    await client.database.transcripts.deleteAll(GuildID);
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Purge")
                                .setDescription(`Deleted data for ${guild.name}`)
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ],
                        components: []
                    });
                } else if (i.customId === "cache") {
                    await i.deferUpdate();
                    await client.memory.forceUpdate(guild.id);
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Cache")
                                .setDescription(`Reset cache for ${guild.name}`)
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ],
                        components: []
                    });
                }
                break;
            }
            case "announce": {
                const channelsToNotify = await client.database.guilds.staffChannels();
                const modal2 = new ModalBuilder()
                    .addComponents(
                        new ActionRowBuilder<TextInputBuilder>().addComponents(
                            new TextInputBuilder()
                                .setStyle(TextInputStyle.Paragraph)
                                .setLabel("Announcement")
                                .setCustomId("announcement")
                                .setPlaceholder("Announcement...")
                        )
                    )
                    .setTitle("Announcement")
                    .setCustomId("announce");
                await i1.showModal(modal2);
                let out: ModalSubmitInteraction;
                try {
                    out = await i1.awaitModalSubmit({
                        filter: (i) => i.customId === "announce" && i.user.id === interaction.user.id,
                        time: 300000
                    });
                } catch {
                    return;
                }
                await out.deferUpdate();
                const announcement = out.fields.getTextInputValue("announcement");
                await interaction.editReply({
                    embeds: [
                        new EmojiEmbed()
                            .setTitle("Announcement")
                            .setDescription(
                                `Announcement will be sent to ${channelsToNotify.length} channels.\n\n${announcement}`
                            )
                            .setStatus("Success")
                            .setEmoji("SETTINGS.STATS.GREEN")
                    ],
                    components: [
                        new ActionRowBuilder<ButtonBuilder>().addComponents(
                            new ButtonBuilder()
                                .setCustomId("confirm")
                                .setLabel("Confirm")
                                .setStyle(ButtonStyle.Success),
                            new ButtonBuilder().setCustomId("cancel").setLabel("Cancel").setStyle(ButtonStyle.Danger)
                        )
                    ]
                });

                let i;
                try {
                    i = await m.awaitMessageComponent<ComponentType.Button>({
                        filter: (i) => i.user.id === interaction.user.id,
                        time: 300000
                    });
                } catch {
                    return;
                }
                if (i.customId === "confirm") {
                    await i.deferUpdate();
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Announcement")
                                .setDescription(
                                    `Sending to ${channelsToNotify.length} channels. Preview:\n\n${announcement}`
                                )
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ],
                        components: []
                    });
                    const announcementEmbed = new EmojiEmbed()
                        .setTitle("Developer Announcement")
                        .setDescription(announcement)
                        .setStatus("Danger")
                        .setEmoji("NUCLEUS.LOGO")
                        .setFooter({
                            text: `Sent by ${interaction.user.username}`,
                            iconURL: interaction.user.displayAvatarURL()
                        });
                    for (const channel of channelsToNotify) {
                        const ch = (await client.channels.fetch(channel)) as GuildTextBasedChannel | null;
                        if (!ch) continue;
                        await ch.send({
                            embeds: [announcementEmbed]
                        });
                    }
                    await interaction.editReply({
                        embeds: [
                            new EmojiEmbed()
                                .setTitle("Announcement")
                                .setDescription(
                                    `Sent to ${channelsToNotify.length} channels. Preview:\n\n${announcement}`
                                )
                                .setStatus("Success")
                                .setEmoji("SETTINGS.STATS.GREEN")
                        ],
                        components: []
                    });
                } else if (i.customId === "cancel") {
                    await i.deferUpdate();
                    await interaction.editReply({
                        embeds: [new EmojiEmbed().setTitle("Announcement Cancelled").setStatus("Danger")],
                        components: []
                    });
                }
                break;
            }
        }
    }
};

export { command };
export { callback };
