From f44c7e268294b2801cd4f259c5de246c993c2959 Mon Sep 17 00:00:00 2001 From: Theo Date: Wed, 27 Mar 2024 15:07:04 +0100 Subject: [PATCH] Updated Readme to show how to deploy a TG bot --- README.md | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/README.md b/README.md index 0856c31..22c21ee 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,47 @@ The game is written using two frameworks: App.tsx is managing state, using Privy hooks, connects to Inco and sends transactions, makes calls to faucet, etc. Game.svelte is rendering the game graphics and animations. + # How to run locally +## Frontend +First, install cloudflared: +```bash +npm i -g cloudflared +``` +Then run: +```bash +cloudflared tunnel --url http://localhost:5173 +``` +This will give you a temporary URL pointing to your local server, hold on to it for now and keep the terminal window open. + To run the project locally, run the following commands: ```bash npm install npm start ``` +## Setup the telegram bot +Open telegram and search for the BotFather and initiate chat with it. Create a new bot: +``` +[You] - Accept + +[You] - /newbot +... complete the steps until BotFather responds with the following: +[BotFather] - Done! Congratulations on your new bot. You will find it at t.me/. + +Then do the following: +/mybots +... BotFather will respond with a list of all your bots. +Choose your newly created bot then press +Bot Settings -> Menu Button -> Edit Menu Button URL + +Now respond with the URL provided to you by cloudflared. +``` +Your bot should now be playable. Go to your bot, press "start" and play the game. + + # How to deploy +## Frontend This project is deployed on GitHub Pages. To deploy, install github CLI ```bash npm install -g gh @@ -36,3 +69,27 @@ Then run ```bash npm run deploy ``` + +Go to your github repository settings and enable GitHub Pages. Set the source to gh-pages branch. +Your game should now be live at https://.github.io/ + + +## Setup the telegram bot +Open telegram and search for the BotFather and initiate chat with it. Create a new bot: +``` +[You] - Accept + +[You] - /newbot +... complete the steps until BotFather responds with the following: +[BotFather] - Done! Congratulations on your new bot. You will find it at t.me/. + +Then do the following: +/mybots +... BotFather will respond with a list of all your bots. +Choose your newly created bot then press +Bot Settings -> Menu Button -> Edit Menu Button URL + +Now respond with the URL pointing to your repos github page https://.github.io/. +``` +Your bot should now be playable. Go to your bot, press "start" and play the game. +