Skip to content

machinat/sociably-4digit-game

Repository files navigation

Sociably 4digit Game

Playing guessing 4 digits game in chatting.

This is an example app built with Sociably framework.

Demo

Try the bot on these chat platforms:

Getting Started

You have to finish the Environments Setup before you start developing.

Run the app in development mode with:

npm run dev

The command does two things:

  1. Start a dev server up. It'll refresh automatically when codes are changed.
  2. Connect a HTTP tunnel to a https://xxx.t.machinat.dev endpoint. It's used to receive webhook requests from the chat platforms.

Environments Setup

Chat Platform Settings

You need to configure the platforms and fill the settings in the .env file. Check .env.example file for guides and usage examples.

Run Dev Server

Start the server with npm run dev command. It should work if all the required environments are filled at the last step.

Initiate Platform Bindings

Keep the dev server running and execute this command in a new command line tab:

npm run migrate

This register webhooks and other settings on the chat platforms. If you want to cancel these changes, use npm run migrate -- --down to revert.

Start Developing

Now you can go to the chat platforms and try your bot. Keep the dev server running while developing. The changes in codes will immediately reflect on the bot.

Learn More

Here are some resources to learn Sociably framework: