Stacked is an economy game about collecting items, gambling, and using them to fight other players, all within Slack (Slack, where the work happens), powered by Supabase.
-
Clone the repository
-
Install dependencies:
pnpm install
-
Create a .env file in the project root:
SLACK_BOT_TOKEN=xoxb-abcdefghijklmnopqrstuvwxyz123456 SLACK_APP_TOKEN=xapp-abcdefghijklmnopqrstuvwxyz123456 SLACK_SIGNING_SECRET=abcdefghijklmnopqrstuvwxyz123456 SUPABASE_URL=https://abcdefghijklmnopqrstuvwxyz123456.supabase.co SUPABASE_SERVICE_ROLE_KEY=abcdefghijklmnopqrstuvwxyz123456 SUPABASE_USERS_TABLE=users
-
Setup the database, here is a oneliner that will get you up and running. You can paste it into your Supabase SQL editor.
CREATE TABLE public.users ( slack_uid text NOT NULL, inventory jsonb NULL DEFAULT '[]'::jsonb, balance numeric NOT NULL DEFAULT '0'::numeric, hp numeric NOT NULL DEFAULT '100'::numeric, opt_status boolean NOT NULL DEFAULT false, attack_cooldown numeric NULL, daily_cooldown numeric NULL, weekly_cooldown numeric NULL, hourly_cooldown numeric NULL, CONSTRAINT users_pkey PRIMARY KEY (slack_uid), CONSTRAINT users_slack_uid_key UNIQUE (slack_uid) );
-
Nab all the emojis, they will be added to the repo in due time™ If you are already in the Hack Club Slack, the emojis are already there and no further action is needed from you.
-
Make sure you add a slash command to your Slack bot. Here is the recommended configuration. Make sure you have escape names and channels selected.
-
Start the bot:
pnpm start
Or if you would like it to auto-reload on changes:
pnpm dev
Yes please! Keep in mind where functions go and what not. Aka just don't mess things up too much.