mirror of
https://github.com/TheShadowEevee/Konpeki-Discord-Bot.git
synced 2025-01-11 22:38:50 -06:00
Add an invite command to share bot invite link
This commit is contained in:
parent
d704b39859
commit
25370e9dc1
1 changed files with 20 additions and 0 deletions
20
commands/invite.js
Normal file
20
commands/invite.js
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
/*
|
||||||
|
* Konpeki Discord Bot - Slash Command Definition File
|
||||||
|
* invite.js - Uses your bot's clientID to create and share it's own invite link
|
||||||
|
*
|
||||||
|
* Function modified from https://discordjs.guide/creating-your-bot/slash-commands.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
const { SlashCommandBuilder } = require('discord.js');
|
||||||
|
|
||||||
|
// Get the clientID and bot name from the config file
|
||||||
|
const { botName, clientId } = require('../config.json');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
data: new SlashCommandBuilder()
|
||||||
|
.setName('invite')
|
||||||
|
.setDescription(`Invite ${botName} to your own server!`),
|
||||||
|
async execute(interaction) {
|
||||||
|
await interaction.reply({ content: `Use this link to invite ${botName} (That's me!) to your own server!\nhttps://discord.com/oauth2/authorize?client_id=${clientId}&permissions=274877908992&scope=bot%20applications.commands`, ephemeral: true });
|
||||||
|
},
|
||||||
|
};
|
Loading…
Reference in a new issue