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

SunnyBoiX

@SunnyBoiX

Joined June 2nd, 2026

  • 3Devlogs
  • 1Projects
  • 0Ships
  • 0Votes
Linux is superior.
Open comments for this post

40m 51s logged

I spent this session going through lots of trouble. I did get my bot working on nest 24/7 but, since I was not complete the bot, I had to continue working on it. I don’t know how but, I completely had forgotten how Nest had worked and spent my time testing the bot locally. When I first tested the bot, running the /pass command gave a frustrating error saying the app did not respond. Looking at the code, I found out the biggest mistake was on the very first line of the /pass block. I wrote await ack; instead of calling it as a function with parentheses like await ack();. Because of this, the bot never sent that quick acknowledgement back to slack, Slack waited for three seconds and gave up. Right after that, I fixed a bug where the code tried to clean up the command text without checking if a user actually tagged anyone. When someone typed just /pass by itself, the text was blank, causing a fatal crash that broke the whole game loop. I added a safety check to use an empty string if no text is found. I also noticed my success message used regular quotes instead of backticks, which broke the user tag formatting, and fixed a simple typo in my error handling that was causing secondary crashes. I finally remembered to log in to my SSH, pull the code from Github, and update .env file with MY SECRET TOKENS >:) and setup a systemd file to keep the script running in the background. Soon, I will go back to in to completely finish and polish the /pass command in order to get rid of the timeout errors once and for all. After doing that, I will make it 24/7 and test if the game works. In the end, I will make a leaderboard system to track everyone’s stats on slack!!!

0
0
20
Open comments for this post

1h 15m 50s logged

Bot Purpose & Code

I finally got an idea on what to make my custom Slack bot based on. I decided to make a hot potato slack bot called Potatpheus. Hot potato + Orpheus = Potatopheus. I set up global variables like gameState and friedLeaderboard to track the game data. I built a function called getRandomSeconds to handle the fuse timing, which works directly into my main explodePotato function to reset the game and log the loss when someone blows up. I added the slash command on the Slack APi called /drop-potato to begin the game. During testing, I encountered a problem which was if someone decided to start a new game while one is already going on. In order to resolve this issue, I used a conditional if statement to check a boolean flag inside my global gameState dictionary and then exited early using a return statement. Specifically, inside the /drop-potato command handler, I set up a restriction that checks if (gameState.isActive). If that boolean evaluates to true, the code uses Slack’s respond function to send a message back to the user (“A game is already active!”), and then directs itself to the return statement to stop itself. This stops the rest of the execution from reaching the setTimeout, ensuring no duplicate timers get created. I will work on the leaderboards and the pass function now.

0
0
45
Open comments for this post

46m 38s logged

Setup & Code - Slack Bot
I followed the tutorial where it teaches you how to make a Slack Bot. I completed the setup and prerequisites before completing the code which were to create the application on Slack. Following all the instructions that were given such as generating tokens. Then, moved onto the code. I copied the code that was provided and replaced the parts I was supposed to. Made a github repository as well and track this with hackatime. This bot currently has no theme and has the same exact commands given in the tutorial. I will give it a specific theme and more commands to make it more fun!

0
0
41

Followers

Loading…