Skip to content

Commit ebd0a48

Browse files
committed
added support for generating invite links
1 parent 8b9c3c8 commit ebd0a48

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

auth.json.example

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
2-
"email" : "email of the discord account here",
3-
"password" : "password of the discord account here",
2+
"email" : "email of the discord account here if using a user account",
3+
"password" : "password of the discord account here if using a user account",
4+
"bot_token" : "bot token if using a bot account",
5+
"client_id" : "client id if using a bot account and you want people to be able to invite it to their server",
46
"youtube_api_key": "create one here https://console.developers.google.com",
57
"google_custom_search": "follow instructions at https://stackoverflow.com/questions/34035422/google-image-search-says-api-no-longer-available",
68
"imgflip_username": "https://imgflip.com/ username",

discord_bot.js

+10
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,16 @@ var commands = {
639639
}
640640
}
641641
};
642+
643+
if(AuthDetails.hasOwnProperty("client_id")){
644+
commands["invite"] = {
645+
description: "generates an invite link you can use to invite the bot to your server",
646+
process: function(bot,msg,suffix){
647+
msg.channel.sendMessage("invite link: https://discordapp.com/oauth2/authorize?&client_id=" + AuthDetails.client_id + "&scope=bot&permissions=470019135");
648+
}
649+
}
650+
}
651+
642652
try{
643653
var rssFeeds = require("./rss.json");
644654
} catch(e) {

0 commit comments

Comments
 (0)