Have you ever wanted your friends to get notified when you start up a game? Have you only wanted certain friends to get notified about certain games? This is the bot for you!
This repo will create a bot that waits in your server and monitors the presences of its users, alerting certain users when a target user has started to play a game.
You'll need to add the bot to your server. You'll follow general instructions for setting up a discord bot.
You can provide a mapping of target to subscriber along with which games the subscriber should be informed about:
{
"164537364092289024": {
"MATTHEW": [],
"265210485812923088": [
"TYLER",
"Overwatch 2",
"Risk of Rain 2",
"Deadlock"
],
"225142521024610302": [
"BRYAN",
"Risk of Rain 2",
"Don't Starve Together"
]
}
}
In the example above (user IDs have been changed), we can provide a human-readable name among the list of games.
When MATTHEW has a change in gaming presence, the bot will check if the game name has a hit for any of the subscribers, at which point the bot will message them. If he plays Overwatch 2, then TYLER will receive a message about that.
No, all user IDs above will need to:
- share a server with the bot
- allow messages from server members (at least for the shared server)
- have their privacy setting configured so that non-friends can message them
The bot has a built-in 2 hour cool-off after messaging a user about a particular game. This cool-off is per game.
The bot will forward their message to you
Yes, you'll need to use the reply
function directly on the message that the bot forwards you
Before you start, make sure you have the following installed:
- Create a new Discord bot and obtain the token. You can do this by creating a new application on the Discord Developer Portal.
- Rename the
.env.example
file to.env
and update the fields with the neccesarry values - Install dependencies using Yarn and start the bot
yarn # installs dependencies
yarn start