diff --git a/README.md b/README.md index 78befe59..5bcfe305 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,8 @@ First you need to create a Discord bot user, which you can do by following the i "irc": ["irc_nick1", "irc_nick2"], // Ignore specified IRC nicks and do not send their messages to Discord. "discord": ["discord_nick1", "discord_nick2"] // Ignore specified Discord nicks and do not send their messages to IRC. }, + // Sets the discord activity status, can be set to one of "PLAYING, STREAMING, LISTENING or WATCHING" + "discordStatus": ["PLAYING", "with you!"], // List of webhooks per channel "webhooks": { "#discord": "https://discordapp.com/api/webhooks/id/token" diff --git a/lib/bot.js b/lib/bot.js index 141b4b5d..5fcc9b02 100644 --- a/lib/bot.js +++ b/lib/bot.js @@ -37,6 +37,7 @@ class Bot { this.ircStatusNotices = options.ircStatusNotices; this.announceSelfJoin = options.announceSelfJoin; this.webhookOptions = options.webhooks; + this.discordStatus = options.discordStatus; // Nicks to ignore this.ignoreUsers = options.ignoreUsers || {}; @@ -125,6 +126,10 @@ class Bot { attachListeners() { this.discord.on('ready', () => { logger.info('Connected to Discord'); + if (this.discordStatus) { + this.discord.user.setActivity(this.discordStatus[1], { type: this.discordStatus[0] }); + logger.info('The activity for', this.discord.user.username, 'has been set to', this.discordStatus[0].toLowerCase(), this.discordStatus[1]); + } }); this.ircClient.on('registered', (message) => {