It's a dynamic Discord bot powered by a REST API that celebrates user achievements by sending personalized congratulatory messages and celebratory GIFs whenever a sprint is completed. It integrates with a database to fetch random messages and store metadata, ensuring a lively and engaging recognition system on any Discord server.
- Congratulate a user on a configured Discord server with the GIF and a message.
- Fetch a random GIF of success from an external GIF.
- Highlight mentioned username in Discord message.
- DB is seeded with data.
- Github Workflow for linting and testing.
- Join test server https://discord.gg/vAxt2mvsNe
- Clone repo, setup and run app:
git clone [email protected]:viliusddd/bravo-bot.git && \
cd bravo-bot && \
cp .env.example .env && \
npm i && \
npm run migrate:latest && \
npm run dev
Important
It appears that discord know when token is exposed in public github repo and resets it, even if it's a throw-away token.
- Execute cUrl POST in cli (or any other cmd from Examples):
curl -sX POST http://localhost:3000/messages \
-H 'Content-Type: application/json' \
-d '{"username": "vjuodz", "sprintCode": "WD-1.3.4"}' | jq
- Voila! Check message at discord server.
- Create a copy of
.env.example
and rename it to.env
- Fill-in
DISCORD_SERVER_ID
,DISCORD_CHANNEL_ID
variables. - Get giphy api key from here
- Create new Discord bot Application at https://discord.com/developers/applications
- On the left-side meniu go to
Bot
and:- enable
SERVER MEMBERS INTENT
- enable
MESSAGE CONTENT INTENT
- press
Reset Token
, then add it to.env
,DISCORD_TOKEN
- enable
- On the left-side menu, go to
OAuth
and, underOAuth2 URL Generator
:- choose
bot
- choose
applications.commands
- at the bottom, under
GENERATED URL
press copy (it should look similar tohttps://discord.com/oauth2/authorize?client_id=1267831555741581382&permissions=0&integration_type=0&scope=bot
) - paste copied url at you internet browser, choose channel you want your bot to reside.
- choose
- Paste yur app token to the
.env
and fill in the rest of the variables.
Post new message
curl -sX POST http://localhost:3000/messages \
-H 'Content-Type: application/json' \
-d '{"username": "vjuodz", "sprintCode": "WD-1.3.4"}' | jq
Get All messages
curl -s http://localhost:3000/messages | jq
Get particular message
curl -s http://localhost:3000/messages/1 | jq
Get messages by username
curl -s http://localhost:3000/messages?username=vjuodz | jq
Get messages by sprintCode
curl -s http://localhost:3000/messages?sprintCode=WD-1.2.5 | jq
Delete message
curl -sX DELETE http://localhost:3000/messages/1 | jq
Replace
sprints
with any of praises, templates, users, emojis
Get all sprints
curl -s http://localhost:3000/sprints | jq
Get single sprint
curl -s http://localhost:3000/sprints/1 | jq
Update sprint
curl -sX PATCH http://localhost:3000/sprints/1 \
-H 'Content-Type: application/json' \
-d '{"sprintCode": "WD-1.2.9", "sprintTitle": "Foo"}' | jq
Delete sprint
curl -sX DELETE http://localhost:3000/sprints/1 | jq