![]()
This bot works in a Telegram group. When someone invites others to split expense, the bot sends a message with buttons to determine who will split and who pays for the expense. Then the bot counts users' balances.
You can use it as server - entrypoint src/server.js (for example, as Okteto Kubernetes service) or serverless - entrypoint src/lambda (for example, as Netlify Lambda Functions).
Dev (@ExSplitDevBot):
~/ngrok http 9000
curl https://api.telegram.org/bot<TELEGRAM_TOKEN>/setWebhook?url=https://<NGROK ID>.ngrok.io/index?token=<TOKEN>
Okteto Kubernetes service:
curl https://api.telegram.org/bot<TELEGRAM_TOKEN>/setWebhook?url=https://app-zinovik.cloud.okteto.net/index?token=<TOKEN>
Netlify Lambda Functions:
curl https://api.telegram.org/bot<TELEGRAM_TOKEN>/setWebhook?url=https://ex-split-bot.netlify.app/.netlify/functions/index?token=<TOKEN>
don't forget to add the bot to the Telegram group, set the administrator role, and disable privacy mode in bot settings!
You can start project as server with db as docker containers:
docker-compose up
Or you can start db as docker container separately:
cd db
docker-compose up
and then start the project as a server:
npm run start:dev
or as lambda functions:
npm run start:lambda
curl localhost:9000/index
curl localhost:9000/users
curl localhost:9000/groups
curl localhost:9000/expenses
KUBECONFIG=okteto-kube.config kubectl apply -f k8s.yml
KUBECONFIG=okteto-kube.config kubectl port-forward service/postgres 9432:5432
KUBECONFIG=okteto-kube.config kubectl logs service/app -f
KUBECONFIG=okteto-kube.config kubectl rollout restart deployment.apps/ex-split-bot
SQL to change expense auto increment last number:
create sequence expense_id_seq;
alter table expense alter id set default nextval('expense_id_seq');
select setval('expense_id_seq', 99, true);
Content type
Image
Digest
Size
400.2 MB
Last updated
over 6 years ago
docker pull zinovik/ex-split-bot