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

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
5

Comments 0

No comments yet. Be the first!