Skip to content
This repository was archived by the owner on Feb 26, 2018. It is now read-only.

Commit 1237e74

Browse files
RemcoRemco
authored andcommitted
Better joining process
1 parent dda12fd commit 1237e74

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ discord_bot_experimental.js
3535
discord_bot_production.js
3636
auth.json
3737
alias.json
38+
*.tern-project
3839

3940
# Folders with UGC should not be uploaded
4041
images

discord_bot.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,10 +634,21 @@ var commands = {
634634
CmdErrorLog.log("debug", bot.joinServer(suffix[1], function(error, server) {
635635
CmdErrorLog.log("debug", "callback: " + arguments);
636636
if (error) {
637-
bot.sendMessage(msg.channel, "failed to join: " + error);
637+
CmdErrorLog.warn("Failed to join a server: " + error);
638+
bot.sendMessage(msg.channel, "Something went wrong, try again.");
638639
} else {
639-
CmdErrorLog.log("debug", "Joined server " + server);
640-
bot.sendMessage(msg.channel, "Successfully joined " + server);
640+
var msgArray = [];
641+
msgArray.push("Yo! I'm **" + bot.user.username + "**, " + msg.author + " invited me to this server.");
642+
msgArray.push("If I'm intended to be in this server, you may use **" + ConfigFile.command_prefix + "help** to see what I can do!");
643+
msgArray.push("If you don't want me here, you may use **" + ConfigFile.command_prefix + "leave** to ask me to leave.");
644+
bot.sendMessage(server.defaultChannel, msgArray);
645+
msgArray = [];
646+
msgArray.push("Hey " + server.owner.username + ", I've joined a server in which you're the founder.");
647+
msgArray.push("I'm " + bot.user.username + " by the way, a Discord bot, meaning that all of the things I do are mostly automated.");
648+
msgArray.push("If you are not keen on having me in your server, you may use `" + ConfigFile.command_prefix + "leave` in the server I'm not welcome in.");
649+
msgArray.push("If you do want me, use `" + ConfigFile.command_prefix + "help` to see what I can do.");
650+
bot.sendMessage(server.owner, msgArray);
651+
bot.sendMessage(msg.channel, "I've successfully joined **" + server.name + "**");
641652
}
642653
}));
643654
} else {

0 commit comments

Comments
 (0)