Add invite command
This commit is contained in:
parent
55b2f4c55e
commit
86d4bd910e
1 changed files with 8 additions and 1 deletions
9
index.js
9
index.js
|
@ -51,7 +51,7 @@ client.on("ready", () => {
|
||||||
startLoop();
|
startLoop();
|
||||||
console.log("I'm alive");
|
console.log("I'm alive");
|
||||||
var obj = client.application.commands;
|
var obj = client.application.commands;
|
||||||
if(process.argv[2]) obj = client.guilds.cache.get("879081086817288264").commands;
|
if(process.argv[2]) obj = client.guilds.cache.get(process.argv[2]).commands;
|
||||||
obj.set([
|
obj.set([
|
||||||
{
|
{
|
||||||
name: "ping",
|
name: "ping",
|
||||||
|
@ -145,6 +145,10 @@ client.on("ready", () => {
|
||||||
{
|
{
|
||||||
name: "apis",
|
name: "apis",
|
||||||
description: "Shows all APIs"
|
description: "Shows all APIs"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "invite",
|
||||||
|
description: "Provides an invite link for the bot"
|
||||||
}
|
}
|
||||||
]).then(cmds => {
|
]).then(cmds => {
|
||||||
console.log("Finished loading all commands");
|
console.log("Finished loading all commands");
|
||||||
|
@ -230,6 +234,9 @@ client.on("interactionCreate", (int) => {
|
||||||
apiArray.push(key + ": " + apis[key]);
|
apiArray.push(key + ": " + apis[key]);
|
||||||
});
|
});
|
||||||
int.reply("Here are all the APIs used in the bot: \n" + apiArray.join("\n"));
|
int.reply("Here are all the APIs used in the bot: \n" + apiArray.join("\n"));
|
||||||
|
} else if(int.commandName == "invite"){
|
||||||
|
var invite = "https://discord.com/api/oauth2/authorize?client_id=679066447942516760&permissions=397434776774&scope=bot%20applications.commands";
|
||||||
|
int.reply("To invite me to your own server, click [here](" + invite + ").");
|
||||||
}
|
}
|
||||||
} else if(int.isButton()){
|
} else if(int.isButton()){
|
||||||
if(int.customId.startsWith("cat")){
|
if(int.customId.startsWith("cat")){
|
||||||
|
|
Loading…
Reference in a new issue