Integration between discord and intercom
- copy discord users to intercom
- broadcast message to multiple discord users
- communicate with discord users via intercom
- node v12.*
- npm v6.*
- https domain name (needed for intercom webhooks handling)
-
add discord bot to your discord server: https://discord.com/developers/applications -> new application -> open this created application -> bot tab -> add bot -> add privileges to bot (ingeger 523328) -> general info tab -> copy CLIENT ID -> open link in browser https://discordapp.com/oauth2/authorize?client_id=&scope=bot -> add bot to your server
-
set
https://<your domain name>/api/intercom/hooks
as webhook endpoint in intercom account
npm ci
cp config.json.example config.json
- fill config.json with your params (discord and intercom tokens, etc)
cp serialized-state.json.example serialized-state.json
- fill serialized-state.json with default state (see format description in serialized-state.ts)
cp serialized-broadcasts-data.json.example serialized-broadcasts-data.json
npm run start
npm run docker:build
- copy
config.json
,serialized-state.json
,serialized-broadcasts-data.json
andrun.bot.sh
to some folder, e.g/tmp/app
cd /tmp/app
chmod +x run.bot.sh
./run.bot.sh
- generate certificate with certbot certonly command
- fill certs location inside docker (/app/certs/fullchain.pem and /app/certs/privkey.pem)
- copy
run.bot.https.sh
to your /tmp/app folder (change path of volume with certs in your host machine according to your domain name) chmod +x run.bot.https.sh
./run.bot.https.sh
- while getting new discord token is free, creating new intercom account needs you to fill credit card details to gain trial
- use ngrok to get https endpoint
- use
ts-node ./intercom/tester.ts
to test your services
- TODO