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

potatonator

  • 4 Devlogs
  • 2 Total hours

šŸ„” Potatonator is a fun, potato-powered Slack bot that brings games, randomness, and potato chaos to your workspace.

Ship #1 Pending review

Potatonator is a Slack bot where users can adopt and manage their own virtual potato. Each potato has its own stats, level, experience points and coins. Users can explore to earn XP and coins, view their potato’s profile and discover random potato facts.

The project uses a Node.js Slack bot alongside a Cloudflare Workers API and Cloudflare D1 database for storing player and potato data. It includes an XP and leveling system that allows potatoes to progress as they gain experience. The bot is hosted on Hack Club Nest and configured as a systemd service so it can run continously without relying on the user’s computer being online.

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

23m logged

I added the /potatonator-explore command, which is the first real gameplay feature for Potatonator.
The idea is that users can send their potato on a random adventure. Each adventure gives the potato XP and coins.
I created a new /explore endpoint in the Cloudflare Worker and added several random events, such as finding treasure, discovering golden potatoes, finding coins, or fighting a carrot.
At first, the API only returned the XP and coins without saving them. I then added a coins column to the D1 database and updated the endpoint so the rewards are permanently saved.
There were a few small issues along the way, including accidentally trying to add the coins column twice, which resulted in a duplicate-column error. Since the first command had already worked, the second one wasn’t needed.
After testing the API locally, I connected /explore to Slack and deployed the updated Cloudflare Worker.
I also updated /potatonator-profile so it displays the coins earned from exploring.

0
0
7
Open comments for this post

19m logged

I added the /potatonator-profile command.
The goal was to let users view the potato they adopted and all of its stats.
First, I created a new /profile endpoint in the Cloudflare Worker. It takes the user’s Slack ID and searches the D1 database for their potato.
I also connected the endpoint to index.ts so Cloudflare knows about the new route.
There was a small issue where the /profile endpoint wasn’t appearing in the API documentation. Turns out VS Code hadn’t properly saved the changes, so after saving a few more times, it worked.
I then tested the endpoint using PowerShell and confirmed that it could retrieve the saved potato.
Finally, I connected the API to the Slack bot using Axios. The bot sends the user’s Slack ID to the API, which retrieves their potato from D1 and sends the information back to Slack.
The command now displays:

šŸ„” Potato name

Type

Rarity

āš”ļø Power

šŸ„” Crunch

šŸ€ Luck

⭐ Level

✨ XP

After testing it in Slack, /potatonator-profile worked successfully.
Potatonator now has both potato adoption and profiles, giving us the foundation for adding actual gameplay features next. šŸ„”

0
0
5
Open comments for this post

1h 0m 6s logged

I started this project with the goal of making a Slack bot that could respond to custom slash commands. I wasn’t sure what the bot should actually do, so I decided to make it potato-themed and named it Potatonator.
I started with basic commands like:

/potatonator-ping

/potatonator-help

/potatonator-potatofact

For the potato facts, I first learned about APIs and Axios, which lets the bot make requests to an API. I originally considered using an existing API, but decided to make my own potato API instead.
I first ran the API locally, but realized that meant it wouldn’t work when my PC was turned off. I decided to move it to Cloudflare Workers, which gave me a permanent URL:
https://potatonator-api.potatonator.workers.dev
I then connected my Slack bot to this API.
After that, I wanted Potatonator to become more like a game, so I created /potatonator-adopt. Users could permanently adopt a randomly generated potato with stats such as:

Name

Type

Rarity

Power

Crunch

Luck

Level

XP

To save this information, I added a Cloudflare D1 database.
There were a few mistakes along the way. I initially ran a command from the wrong folder, and later discovered that my local D1 database didn’t have the table even though the remote database did. I also had an issue where Axios treated the ā€œalready have a potatoā€ response as an error. After fixing these, everything worked.
Now /potatonator-adopt successfully creates a potato and remembers it even after the bot restarts.
Next, I’m planning to add /potatonator-profile, which will let users view their potato and its stats.

0
0
5

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…