@mokshjain939 on My first slack bot!
I built a Slack bot using Node.js and Slack Bolt. The bot responds to several slash commands, including ping, hello, echo, random cat facts, random jokes, a help command that lists all available commands, and a few other commands.
Writing the code part was straightforward, as the guide provided examples of how code for the slash command to be executed looks like, so one could identify the changes required to achieve the desired result for a similar command.
The harder part was learning how all the different technologies (Node.js, Git, GitHub server) worked together through the Git push and git pull mechanism. I had to first learn how to set up a Slack app, followed by connecting it to my code, use Git and GitHub, deploy the bot to a VPS, and keep it running using systemd. I also ran into a few debugging issues where the older versions of the code were still being used, which taught me how deployment, Git, SSH, and updating the server actually work.
I am proud that I was able to get the bot running 24/7 on a remote server and understand how coding locally, then pushing and pulling the changes, and updating the live bot works.
To test the bot, use any of the following commands in Slack:
1. /dsb-ping-mj - Check the bot's latency.
2. /dsb-echo-mj - Repeat what you say.
3. /dsb-hello-mj - Greet the bot.
4. /dsb-catfact-mj - Get a random cat fact.
5. /dsb-joke-mj - Get a random joke.
6. /dsb-help-mj - Show this help message.
7. /dsb-dogpic-mj - Get a random dog picture.
8. /dsb-catpic-mj - Get a random cat picture.
9. /dsb-howareyou-mj - Ask the bot how it's doing.
10. /dsb-napd-mj - View the NASA Astronomy Picture of the Day.
11. /dsb-meme-mj - Get a random meme.
The source code and README are in the GitHub repository-https://github.com/mokshjain939-cmd/MJ-s-Stardance-Bot.
- 3 devlogs
- 3h
- Make a Slack Bot