SlickSlackSloe
- 3 Devlogs
- 4 Total hours
A Tic-Tac-Toe Slack bot
A Tic-Tac-Toe Slack bot
Shortly after my last devlog I found out about Slack block kits. It took a bit of trial and error but I managed to make a matrix of buttons which I will use as the board itself.
I wanted to be able to see which button was pressed. For this I was going to use the action_id from the response payload. It took me a while to figure out how to get it because action_id is not a part of body (either is response_url and many other values that are actually a part of body) according to VScode but they actually are.
I figured that the board shouldn’t be able to be interacted with by anyone so I got the idea to make the message “Only visible to you”. It took me a bit of DuckDuckGoing to get it to work but it works.
My first decision was to rewrite the bot in Typescript because I have a bit more experience with it. It took a bit of troubleshooting but I got it working in the end.
My second decision was to decide the command syntax. After very little thought I came up with /slickslacksloe command [argument] .
This basically means that commands have the syntax /command [argument] but with the prefix slickslacksloe so it’s actually findable in Slack.
The first command I made was the /slickslacksloe help command. It displays all available commands and gives a short description.
I still haven’t fully decided about how I should show what values arguments can have. Right now its <value1, value2, valueN> but it’s not super clear and it’s a bit ugly.
I will make a pfp for the bot but that will probably take a while to get to. I’m thinking that the next step will probably be making some tic-tac-toe logic. Storing the board, handling win/lose conditions, and handling several games (from different) users at the same time.
I might rework it a bit and make the only command start and make the game be controlled with reactions but I’m not sure.