You are browsing as a guest. Sign up (or log in) to start making projects!

friday

  • 1 Devlogs
  • 1 Total hours

This bot isn't slacking off, it replies to messages 24/7!

Ship #1

What did you make?

I made Friday, a Slack assistant bot built using Node.js and the Slack Bolt framework. It acts as a collection of small utilities that brings useful tools directly into Slack instead of requiring users to visit different websites.

Friday handles eleven slash commands that connect to public APIs for weather, GitHub, jokes, quotes, facts, cat facts, web searching, coding assistance, etc.

/friday-help
/friday-ping
/friday-cat
/friday-joke
/friday-quote
/friday-dev
/friday-code
/friday-web
/friday-fact
/friday-git
/friday-weather

What was challenging?

The first hurdle was getting my bot to be acknowledged by Slack. I had to configure the Slack app, enable Socket Mode, set permissions, get the bot and app tokens, and make sure my slash commands would not conflict with other bots in the Hack Club workspace.

Then came the classic developer question: “Why is my bot not working?” I eventually found an authentication error, fixed it, and Friday responded:

🏓 Friday is Online!
Latency: xx ms

That was the moment everything started feeling real.

The next challenge was deploying Friday so it could run 24/7. Running node index.js on my laptop meant the bot depended on my laptop staying on. I learned SSH, connected to my Debian server on Hack Club Nest, cloned my GitHub repository, installed Node.js and npm, configured my environment variables, tested the bot, and used PM2 as a 24/7 process manager.

I then disconnected my laptop and tested /friday-ping. Friday still responded. That was the cherry on top.

I also had a minor but very annoying battle with Windows and SSH because apparently a backslash and a dot are not synonyms, despite what Windows seemed to suggest.

What are you proud of?

I’m proud that I took the idea from “I want to make a Slack bot” to an actually deployed application.

I stitched together:

JavaScript
Slack Bolt
Slack Socket Mode
Public APIs
GitHub
Linux/SSH
Hack Club Nest
PM2
24/7 hosting

The biggest thing I learned is that my laptop doesn’t have to be the computer hosting my applications. Friday now runs on my Hack Club Nest server, while I can remotely manage it through SSH.

What should people know so they can test your project?

Friday runs on Hack Club Nest, so it doesn’t depend on my laptop being turned on.

In the Slack demo channel, try:

/friday-help

to see all commands.

Then try:

/friday-ping

to check if Friday is online.

You can also try:

/friday-weather

for the current weather in Tirupati,

/friday-git octocat

for GitHub profile information,

or:

/friday-joke

for a random joke.

The code is available on GitHub, while the bot can be tested directly in the demo channel.

The main thing I’d like people to know is that Friday isn’t just a list of commands sitting in a GitHub repository. It is a real Slack application connected to various APIs, deployed on a Linux server, and running even when my laptop is completely shut down.

Try project → See source code →
Open comments for this post

37m 18s logged

Friday - Slack Assistant Bot
Overview

Yesterday I started my project, and I wanted to make a slack bot with some custom slash commands. Today my bot named

Friday is running 24/7 on my Hack Club Nest.
First thing first I had to name my bot,
Friday
I created a slack app and linked it to my workspace,
turned on the Socket Mode so my bot wouldn’t require a public url
and
I created custom slash commands that would be “/friday-”
so commands would not be overriden by other apps. My bot was created with
Node.js and JavaScript using slack’s bolt framework. I created the “/friday-ping” command first to make sure my bot was working properly. After that I created and added 11 other commands to my bot for assistance, jokes, quotes, coding help, facts, web searching, github, and the weather.
To make my commands functional I used public rest apis with Axios
I also added error handling so my bot wouldn’t crash when a certain api was down.
After that I learned about the ack() and respond() functions within my slack app.
To make my credential keys secure I created a “.env” file and a “.gitignore” file so those files wouldn’t be pushed to my github.
Next I published my project to my github and pushed all my work there. After that I applied for a Hack Club Nest container where my bot would be hosted 24/7, and I learned how to connect to my server via SSH.
To connect to my Debian server from my Windows PC I created an SSH key,
I installed Git, Node, and NPM to my server,
cloned my GitHub repository to my server, and added my production “.env”.
Finally, I used PM2 to make sure my bot was running on my server, and I detached my laptop from my server. I used my “/friday-ping” command one last time to make sure everything was working fine, and if it was my bot was live and running on my Hack Club Nest!

0
0
6

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…