diff options
Diffstat (limited to 'commands')
| -rw-r--r-- | commands/about.js | 28 | ||||
| -rw-r--r-- | commands/control.js | 26 | ||||
| -rw-r--r-- | commands/help.js | 21 | ||||
| -rw-r--r-- | commands/ping.js | 10 |
4 files changed, 85 insertions, 0 deletions
diff --git a/commands/about.js b/commands/about.js new file mode 100644 index 0000000..033c44f --- /dev/null +++ b/commands/about.js @@ -0,0 +1,28 @@ +const { SlashCommandBuilder } = require('@discordjs/builders'); +const { MessageEmbed, version, MessageActionRow, MessageButton } = require("discord.js"); + +module.exports = { + data: new SlashCommandBuilder() + .setName('about') + .setDescription('Information about the bot'), + async execute(interaction, bot) { + const aboutEmbed = new MessageEmbed() + .setAuthor({name:`About ${bot.user.username}`, iconURL:bot.user.avatarURL()}) + .addField('Information', 'A Discord bot that plays local mp3 audio tracks.') + .addField('Original Creator', 'Andrew Lee (Alee#4277)') + .addField('Frameworks', `Discord.JS ${version} + Voice`) + .addField('License', 'GNU General Public License v3.0') + .setFooter({text:'© Copyright 2020-2022 Andrew Lee. Licensed with GPL-3.0.'}) + .setColor('#0066ff') + + const srcOrig = new MessageActionRow() + .addComponents( + new MessageButton() + .setStyle('LINK') + .setLabel('Original Source Code') + .setURL('https://github.com/Alee14/DLMP3'), + ); + + return interaction.reply({ embeds:[aboutEmbed], components:[srcOrig] }); + }, +};
\ No newline at end of file diff --git a/commands/control.js b/commands/control.js new file mode 100644 index 0000000..f5846e2 --- /dev/null +++ b/commands/control.js @@ -0,0 +1,26 @@ +const { SlashCommandBuilder } = require('@discordjs/builders'); +const { MessageEmbed, MessageActionRow, MessageButton } = require("discord.js"); + + +module.exports = { + data: new SlashCommandBuilder() + .setName('control') + .setDescription('Controlling the music'), + async execute(interaction, bot) { + const controlEmbed = new MessageEmbed() + .setAuthor({name:`${bot.user.username} Control Panel`, iconURL:bot.user.avatarURL()}) + .addField('Currently Playing', 'audio file here') + .addField('Next Music', '(a possible feature?)') + .setColor('#0066ff') + + const controlButtons = new MessageActionRow() + .addComponents( + new MessageButton() + .setStyle('PRIMARY') + .setLabel('Pause') + .setCustomId('soon') + ); + + return interaction.reply({embeds:[controlEmbed], components:[controlButtons]}); + }, +};
\ No newline at end of file diff --git a/commands/help.js b/commands/help.js new file mode 100644 index 0000000..67ed896 --- /dev/null +++ b/commands/help.js @@ -0,0 +1,21 @@ +const { SlashCommandBuilder } = require('@discordjs/builders'); +const { MessageEmbed } = require("discord.js"); +const { AudioResource } = require("@discordjs/voice"); +const config = require("../config.json"); + +module.exports = { + data: new SlashCommandBuilder() + .setName('help') + .setDescription('Lists the commands'), + async execute(interaction, bot, audio) { + const helpEmbed = new MessageEmbed() + .setAuthor({name:`${bot.user.username} Help`, iconURL:bot.user.avatarURL()}) + .setDescription(`Currently playing \`${audio}\`.`) + .addField('Public Commands', `/help\n/ping\n/about\n`, true) + .addField('Bot Owner Only', `/join\n/control\n/stop\n`, true) + .setFooter({text:'© Copyright 2020-2022 Andrew Lee. Licensed with GPL-3.0.'}) + .setColor('#0066ff') + + return interaction.reply({ embeds: [helpEmbed]}); + }, +};
\ No newline at end of file diff --git a/commands/ping.js b/commands/ping.js new file mode 100644 index 0000000..c5b4885 --- /dev/null +++ b/commands/ping.js @@ -0,0 +1,10 @@ +const { SlashCommandBuilder } = require('@discordjs/builders'); + +module.exports = { + data: new SlashCommandBuilder() + .setName('ping') + .setDescription('Replies with Pong!'), + async execute(interaction) { + return interaction.reply('Pong!'); + }, +};
\ No newline at end of file |
