From f9d75b3531c05dd3f1dba38ca1b64f7c6e4a295d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=85dne=20E=2E=20Moldes=C3=A6ter?= Date: Mon, 30 Dec 2019 19:57:54 +0100 Subject: [PATCH] Added status message --- bot.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bot.js b/bot.js index 948cf2a..9ad9a21 100644 --- a/bot.js +++ b/bot.js @@ -16,11 +16,11 @@ const logger = winston.createLogger({ const get_auth = () => { if (process.env.DISCORD_TOKEN != undefined) { - logger.info('using auth from environment variable'); - return { token: process.env.DISCORD_TOKEN }; + logger.info('using auth from environment variable'); + return { token: process.env.DISCORD_TOKEN }; } else { - logger.info('using auth from auth.json file'); - return JSON.parse(fs.readFileSync('./auth.json', 'utf8')); + logger.info('using auth from auth.json file'); + return JSON.parse(fs.readFileSync('./auth.json', 'utf8')); } }; @@ -33,6 +33,11 @@ var bot = new Discord.Client({ bot.on('ready', function (evt) { logger.info('Connected'); logger.info('Logged in as: ' + bot.username + ' - (' + bot.id + ')'); + bot.setPresence({ + game: { + name: 'with dice' + } + }); }); bot.on('message', function (user, userID, channelID, message, evt) { @@ -77,7 +82,7 @@ bot.on('message', function (user, userID, channelID, message, evt) { } }); -function error(error, channelID){ +function error(error, channelID) { var res = "Sorry, something went wrong."; sendMessage(channelID, res);