Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { config } from '../../modules/config/cfg';
- var MSGID = '';
- var AUTHORID = '';
- var guildId = config.guildId;
- config.commands.handler.raw(
- {
- name: 'menu',
- aliases: ['help', 'h', 'cmd', 'commands', 'cmds', 'cmdhelp', 'chelp'],
- description: 'Pylon Help Menu',
- filters: config.modules.permissions.user
- },
- async (msg) => {
- const guild = await discord.getGuild();
- const menu = new discord.Embed();
- await menu.setColor(config.embeds.COLOR);
- await menu.setFooter({
- text: config.msg.FOOTER_TEXT,
- iconUrl: `${guild.getIconUrl(discord.ImageType.PNG)}`
- });
- await menu.setTitle('Pylon Help Menu');
- await menu.setDescription(
- `Select an option to see what commands are available.\n
- \\${config.emoji.GEAR} **Administration Commands**
- \\${config.emoji.WRENCH} **Moderatoration Commands**
- \\${config.emoji.SOCIAL} **Social Commands**
- \\${config.emoji.TOOLS} **Utility Commands**
- \\${config.emoji.MONEY} **Economy Commands**
- \\${config.emoji.EXIT} **Cancel**
- `
- );
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.menu.enabled
- )
- return;
- const thehelpmsg = await msg.reply(menu);
- await thehelpmsg.addReaction(config.emoji.GEAR); //** Adminstrator commands */
- await thehelpmsg.addReaction(config.emoji.WRENCH); //** Moderator Commands */
- await thehelpmsg.addReaction(config.emoji.SOCIAL); //** Social Commands */
- await thehelpmsg.addReaction(config.emoji.TOOLS); //** Utility Commands */
- await thehelpmsg.addReaction(config.emoji.MONEY); //** Economy Commands */
- await thehelpmsg.addReaction(config.emoji.EXIT); //** Cancel */
- MSGID = thehelpmsg.id;
- AUTHORID = msg.author.id;
- }
- );
- discord.registerEventHandler('MESSAGE_REACTION_ADD', async (theReaction) => {
- const guild = await discord.getGuild(guildId);
- const theMsgChannel = await discord.getGuildTextChannel(
- theReaction.channelId
- );
- const theMsg = await theMsgChannel.getMessage(theReaction.messageId);
- if (
- theReaction.emoji.name == config.emoji.GEAR && //** Administration Commands */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option1 = new discord.Embed();
- await option1.setColor(0x3f888f);
- await option1.setTitle(
- config.emoji.GEAR + ' __Administration Commands__ ' + config.emoji.GEAR
- );
- await option1.setDescription(
- `\`\`\`yaml\n${config.msg.ADMIN_COMMANDS}\`\`\``
- );
- const theMsg1 = await theMsg.reply(option1);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- if (
- theReaction.emoji.name == config.emoji.WRENCH && //** Moderation Commands */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option2 = new discord.Embed();
- await option2.setColor(0x3f888f);
- await option2.setTitle(
- config.emoji.WRENCH + ' __Moderation Commands__ ' + config.emoji.WRENCH
- );
- await option2.setDescription(
- `\`\`\`yaml\n${config.msg.MOD_COMMANDS}\`\`\``
- );
- const theMsg2 = await theMsg.reply(option2);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- if (
- theReaction.emoji.name == config.emoji.SOCIAL && //** Social Commands */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option3 = new discord.Embed();
- await option3.setColor(0x3f888f);
- await option3.setTitle(
- config.emoji.SOCIAL + ' __Social Commands__ ' + config.emoji.SOCIAL
- );
- await option3.setDescription(
- `\`\`\`yaml\n${config.msg.SOCIAL_COMMANDS}\`\`\``
- );
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.menu.enabled
- )
- return;
- const theMsg3 = await theMsg.reply(option3);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- if (
- theReaction.emoji.name == config.emoji.TOOLS && //** Utility Commands */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option4 = new discord.Embed();
- await option4.setColor(0x3f888f);
- await option4.setTitle(
- config.emoji.TOOLS + ' __Utility Commands__ ' + config.emoji.TOOLS
- );
- await option4.setDescription(
- `\`\`\`yaml\n${config.msg.UTIL_COMMANDS}\`\`\``
- );
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.menu.enabled
- )
- return;
- const theMsg4 = await theMsg.reply(option4);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- if (
- theReaction.emoji.name == config.emoji.MONEY && //** Economy Commands */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option5 = new discord.Embed();
- await option5.setColor(0x3f888f);
- await option5.setTitle(
- config.emoji.MONEY + ' __Economy Commands__ ' + config.emoji.MONEY
- );
- await option5.setDescription(
- `\`\`\`yaml\n${config.msg.ECONOMY_COMMANDS}\`\`\``
- );
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.menu.enabled
- )
- return;
- const theMsg5 = await theMsg.reply(option5);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- if (
- theReaction.emoji.name == config.emoji.EXIT && //** Cancel */
- theReaction.messageId == MSGID &&
- theReaction.member.user.id == AUTHORID
- ) {
- const option8 = new discord.Embed();
- await option8.setColor(0x3f888f);
- await option8.setTitle('**Canceled**');
- await option8.setDescription(config.msg.MENU_RESPONSE_1);
- if (
- !config.modules.util.enabled &&
- !config.modules.util.commands.menu.enabled
- )
- return;
- const theMsg8 = await theMsg.reply(option8);
- MSGID = '';
- AUTHORID = '';
- await theMsg.delete();
- }
- });
Add Comment
Please, Sign In to add comment