Skip to content

Commit

Permalink
Updated Readme to show how to deploy a TG bot
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoXD committed Mar 27, 2024
1 parent 4fa51dc commit f44c7e2
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<Bot Username>.
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
Expand All @@ -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://<username>.github.io/<repo-name>


## 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/<Bot Username>.
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://<username>.github.io/<repo-name>.
```
Your bot should now be playable. Go to your bot, press "start" and play the game.

0 comments on commit f44c7e2

Please sign in to comment.