1.0.1 • Published 1 year ago

mod-utils.js v1.0.1

Weekly downloads
-
License
SEE LICENSE IN mo...
Repository
-
Last release
1 year ago

mod-utils.js

An simple package that will help your moderation systsm more advanced.

Basic Example

ConfirmButtons

// Define the module
const { confirmButtons } = require("mod-utils.js");
const { EmbedBuilder, ButtonStyle } = require("discord.js")
await interaction.deferReply();

const embed = new EmbedBuilder()
.setTitle("OH HI")
.setDescription("hmmmm")
.setColor("#303136")

confirmButtons(interaction, {
            embed: embed,
            authorOnly: `Only <@${interaction.member.id}> can use these buttons`,
            yes: {
                style: ButtonStyle.Primary,
                label: "Yes",
                emoji: "✔️",
            },
            no: {
                style: ButtonStyle.Secondary,
                label: "No",
                emoji: "🛑",
            },
        }).then(async (confirm) => {
            if (confirm === "yes") {
                interaction.editReply({
                    content: `Content to show when pressed yes`,
                });
            if (confirm === "no") {
                interaction.editReply({
                    content: `Content to show when pressed no`,
                });
            }
            if (confirm === "time") {
                interaction.editReply({
                    content: `Time up content`,
                });
            }
        });

more examples should be added soon....