Skip to content

Commit be6bc40

Browse files
author
nindwen
committed
Add config option discordStatus
1 parent f660afd commit be6bc40

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ First you need to create a Discord bot user, which you can do by following the i
9393
"ignoreUsers": {
9494
"irc": ["irc_nick1", "irc_nick2"], // Ignore specified IRC nicks and do not send their messages to Discord.
9595
"discord": ["discord_nick1", "discord_nick2"] // Ignore specified Discord nicks and do not send their messages to IRC.
96-
}
96+
},
97+
"discordStatus": "IRC"
9798
}
9899
]
99100
```

lib/bot.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Bot {
3636
this.channels = _.values(options.channelMapping);
3737
this.ircStatusNotices = options.ircStatusNotices;
3838
this.announceSelfJoin = options.announceSelfJoin;
39+
this.discordStatus = options.discordStatus;
3940

4041
// Nicks to ignore
4142
this.ignoreUsers = options.ignoreUsers || {};
@@ -113,6 +114,12 @@ class Bot {
113114
attachListeners() {
114115
this.discord.on('ready', () => {
115116
logger.info('Connected to Discord');
117+
if (this.discordStatus) {
118+
this.discord.user.setPresence({
119+
status: 'online',
120+
game: { name: this.discordStatus }
121+
});
122+
}
116123
});
117124

118125
this.ircClient.on('registered', (message) => {

0 commit comments

Comments
 (0)