Syrup / discord-menus

Create beautiful menus in Discord, with ease! With Discord.js v14

Home Page:https://www.discord-menus.remyk.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

drawing

Made with Typescript


NOTE: this is not completed yet.

πŸ”© Installation

NPM version:

npm install discord-menus@latest

fork version:

npm install github:Syrup/discord-menus

🌌 Setup

const { DiscordMenus } = require('discord-menus');
// Or typescript
import { DiscordMenus } from 'discord-menus';

πŸ’» Code example

All the code examples are available in the tests folder of the project, available on Github, the documentation is coming soon, for more information, join the RemyK Discord server

message:

const { DiscordMenus, ButtonBuilder, MenuBuilder } = require('discord-menus');
const { Client, EmbedBuilder }  = require('discord.js');

const client = new Client();
const MenusManager = new DiscordMenus(client);

const myCoolMenu = new MenuBuilder()
    .addLabel('Value 1', { description: 'This the value 1 description', value: 'value-1' })
    .addLabel('Value 2', { description: 'This is the value 2 description', value: 'value-2' })
    .addLabel('Value 3', {
        description: 'This is the value 3 description (with an emoji)', value: 'value-3', emoji: {
            name: '🌌'
        }
    })
    .setMaxValues(3)
    .setMinValues(1)
    .setCustomID('cool-custom-id')
    .setPlaceHolder('Select an option');

client.on('message', async (message) => {
    if (message.content === '!menu') {
        await MenusManager.sendMenu(message, new EmbedBuilder().setDescription('Hello world!'), { menu: myCoolMenu }).then(msg => {
            console.log(msg.id);
            await msg.edit('Some edit');
        })
    }
});

MenusManager.on('menuClicked', (menu) => {
    menu.reply('some reply')
    console.log(menu.values);
});

client.login('token');

interaction:

const { DiscordMenus, ButtonBuilder, MenuBuilder } = require('discord-menus');
const { Client, EmbedBuilder }  = require('discord.js');

const client = new Client();
const MenusManager = new DiscordMenus(client);

const myCoolMenu = new MenuBuilder()
    .addLabel('Value 1', { description: 'This the value 1 description', value: 'value-1' })
    .addLabel('Value 2', { description: 'This is the value 2 description', value: 'value-2' })
    .addLabel('Value 3', {
        description: 'This is the value 3 description (with an emoji)', value: 'value-3', emoji: {
            name: '🌌'
        }
    })
    .setMaxValues(3)
    .setMinValues(1)
    .setCustomID('cool-custom-id')
    .setPlaceHolder('Select an option');

client.on('interactionCreate', async (interaction) => {
    if(!interaction.isCommand()) return
    if (interaction.commandName === '!menu') {
        await MenusManager.sendMenu(interaction, new EmbedBuilder().setDescription('Hello world!'), { menu: myCoolMenu }).then(m => {
            console.log(msg.id);
            await msg.edit('Some edit');
        })
    }
});

MenusManager.on('menuClicked', (menu) => {
    menu.reply('some reply')
    console.log(menu.values);
});

client.login('token');

πŸ“· Image

Image 1


Image 2


πŸ‘₯ Contact

Discord Banner 1

You can join the RemyK Dev Discord server using this link

πŸš€ Others

This package is under Apache-2.0 license

Github repository

Made with ❀ by RemyK

About

Create beautiful menus in Discord, with ease! With Discord.js v14

https://www.discord-menus.remyk.net/

License:Apache License 2.0


Languages

Language:JavaScript 52.3%Language:TypeScript 47.7%