Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option discordStatus #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ First you need to create a Discord bot user, which you can do by following the i
"ignoreUsers": {
"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.
}
},
"discordStatus": "IRC"
}
]
```
Expand Down
7 changes: 7 additions & 0 deletions lib/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Bot {
this.channels = _.values(options.channelMapping);
this.ircStatusNotices = options.ircStatusNotices;
this.announceSelfJoin = options.announceSelfJoin;
this.discordStatus = options.discordStatus;

// Nicks to ignore
this.ignoreUsers = options.ignoreUsers || {};
Expand Down Expand Up @@ -113,6 +114,12 @@ class Bot {
attachListeners() {
this.discord.on('ready', () => {
logger.info('Connected to Discord');
if (this.discordStatus) {
this.discord.user.setPresence({
status: 'online',
game: { name: this.discordStatus }
});
}
});

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