This is a discord bot that can mention you when specific phrases you set are used by others in chat. It was created to replicate the highlight word functionality from Slack and Skype.
@mentionbot mode <channel|dm|off> : turn mentions on or off for your user and choose method
@mentionbot name <username|nickname|both|off> : turn on mentions for your names
@mentionbot add <1>, <2>, <3> : add phrases that you should be mentioned for
@mentionbot remove <1>, <2>, <3> : remove phrases that you should be mentioned for
@mentionbot list : list your settings and added mention phrases
@mentionbot channel #<channel name> : set channel for mentions to appear in (admin only)
@mentionbot init : Manually initialize server if bot isn't working (admin only)
@mentionbot help : display available commands
-
Create a Discord bot here
-
Deploy the app
-
Invite it to a server at
https://discordapp.com/oauth2/authorize?client_id=<your bot client id>&scope=bot&permissions=19456
- If the bot was already in your server before you deployed the app, you may need to run the
init
command to get everything working - Admins must set a mentions channel using the
channel
command before users can select the channel mode - To enable mentions for your user you need to
- Choose a mode with the
mode
command - Choose a name option with the
name
command (optional) - Choose mention phrases using the
add
command
- Choose a mode with the
Your messages are never stored. Anonymous data that contains your settings is stored on a secure private database.
- A PostgreSQL Database
- Download from https://www.postgresql.org/
- Create a database
- Node.js
- Install from https://nodejs.org/
- run
npm install
- set environment variables
DATABASE_URL
: connection url to your database in the form"postgres://<username>:<password>@<host>:<port>/<db name>"
CLIENT_ID
: Discord bot client. Get one hereTOKEN
: Discord bot token. Get one hereSENTRY_DSN
: Sentry reporting URL. Get one here
- Run migrations
npm install -g knex && knex migrate:latest
- run
npm start
- Clone the repo
git clone https://github.com/matthewdias/mentionbot
- Create postgres container
docker run --name=mentionbot_db -e POSTGRES_USER=mentionbot -e POSTGRES_PASSWORD=[password] -e POSTGRES_DB=mentionbot -v /var/lib/postgresql/data -d postgres:alpine
- Build the docker container
docker build -t mentionbot .
- Create the container
docker create --name=mentionbot --link mentionbot_db:mentionbot_db -e DATABASE_URL=postgres://mentionbot:[password]@mentionbot_db/mentionbot -e CLIENT_ID=[clientid] -e TOKEN=[token] -e SENTRY_DSN=[url] -d mentionbot
- Run database migrations
docker exec -t -i mentionbot knex migrate:latest
- Restart the container
docker restart mentionbot