Clarify the name of the exported function from greeting

master
Miikka Virtanen 2017-07-24 02:09:06 +03:00
parent 3828e9f7ee
commit 32fa668770
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@ const config = require('../config');
const greetingGuildId = config.mainGuildId || config.greetingGuildId; const greetingGuildId = config.mainGuildId || config.greetingGuildId;
function enable(bot) { function init(bot) {
if (! config.enableGreeting) return; if (! config.enableGreeting) return;
bot.on('guildMemberAdd', (guild, member) => { bot.on('guildMemberAdd', (guild, member) => {
@ -30,5 +30,5 @@ function enable(bot) {
} }
module.exports = { module.exports = {
enable, init,
}; };

View File

@ -253,7 +253,7 @@ function reply(msg, text, anonymous = false) {
msg.channel.createMessage(`[${timestamp}] » ${logContent}`); msg.channel.createMessage(`[${timestamp}] » ${logContent}`);
}, (err) => { }, (err) => {
if (err.resp && err.resp.statusCode === 403) { if (err.resp && err.resp.statusCode === 403) {
msg.channel.createMessage(`Could not send reply; the user has likely blocked the bot`); msg.channel.createMessage(`Could not send reply; the user has likely left the server or blocked the bot`);
} else if (err.resp) { } else if (err.resp) {
msg.channel.createMessage(`Could not send reply; error code ${err.resp.statusCode}`); msg.channel.createMessage(`Could not send reply; error code ${err.resp.statusCode}`);
} else { } else {
@ -430,5 +430,5 @@ bot.registerCommand('logs', (msg, args) => {
bot.connect(); bot.connect();
restBot.connect(); restBot.connect();
webserver.run(); webserver.run();
greeting.enable(bot); greeting.init(bot);