This open-source Telegram bot helps parse and sort poker ledgers from the pokernow.club app. It processes CSV ledger files sent to the bot, rearranges the ledger entries from winners to losers, and sends the sorted ledger back to the user.
To set up and test this project locally, follow these steps:
- Clone the repository and navigate to the project folder:
git clone https://github.com/nystera/TelegramPokerLedgerBot.git
cd TelegramPokerLedgerBot
- Install the project dependencies using Yarn:
yarn- Create a .env file in the project root folder with the following variables:
BOT_TOKEN=your_bot_token
WEBHOOK_URL=your_webhook_url-
Create a Telegram bot and obtain its token, you can follow these steps:
- Open the Telegram app and search for the
BotFatherbot. - Start a chat with
BotFatherand send the/newbotcommand. - Follow the instructions provided by
BotFatherto create a new bot and get its API token.
- Open the Telegram app and search for the
-
Setup a local public url for the server to hook the webhook onto. For local webhook testing, you can use a service like
ngrokto create a public URL for your local server. To set upngrok:- Install
ngrokglobally:
npm install -g ngrok
- In a new terminal, start
ngrokto create a tunnel to your local server:
ngrok http 3000
- Copy the
ForwardingHTTPS version of the public URL provided by ngrok and set it as theWEBHOOK_URLin your.envfile. - Start the express server:
yarn run dev
- Install
-
When chatting with the bot, you can do a quick health check by typing
/startto the bot. If it replies, it is up and working. You can now send the.csvfile for them to parse the ledger to you.
WIP! Currently only able to send .csv file and bot will reply as a collated ledger
Here are some planned features for future development:
-
Allow the bot to be added to a group, so any member can send CSV ledger files.
-
Introduce a feature to mark a ledger as completed or not completed.
-
Set up a database to store the ledger history.
-
Ensure the ledger history only includes the members in the group.
-
Update the ledger history only when it's settled.
Simply raise an issue or MR and I'll take a look into it (when I have the time xd)
