Skip to content

Luxenonbeterris/currency-exchange-bot

Repository files navigation

🤖 Currency Exchange Bot


Open on Telegram


A clean, button‑only Telegram bot for currency rates and conversions. New users pick language → source → base currency, then choose between:

-	1 BASE → all — view a well‑formatted table of rates for 1 base currency against all others (sortable).
-	Convert amount — pick a target and enter an amount using an on‑screen numeric keypad (no typing).

Everything is persistent: language, data source (CBR/API), and base currency are saved and editable in Settings.


✨ Highlights

-	🧭 Onboarding flow: Language → Source (CBR/API) → Base currency (paginated list)
-	🧮 Calculator: keypad input, precise conversion, result in monospace
-	📊 Tables: aligned monospace output with sorting (code/name/rate)
-	💾 Persistence: user preferences survive bot restarts (PicklePersistence)
-	🔐 Secure config: .env for BOT_TOKEN, CURRENCYLAYER_API_KEY
-	🚀 Deployable anywhere: Heroku/Railway/Render or any VPS

🗂 Structure

src/ APIRate.py # currencylayer cross‑rates for arbitrary base BotMain.py # button‑only flow, i18n, persistence, calculator WEBScrappa.py # CBR rates via BeautifulSoup config.py # loads secrets from .env requirements.txt Procfile | runtime.txt (optional for Heroku)


⚙️ Setup

python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt cp .env.example .env # then fill values python src/BotMain.py

.env

BOT_TOKEN=YOUR_TELEGRAM_BOT_TOKEN CURRENCYLAYER_API_KEY=YOUR_CURRENCYLAYER_API_KEY


🧪 Try it

1.	/start → choose language
2.	Choose source: CBR or currencylayer
3.	Choose base currency (paginated)
4.	Main menu:
-	1 BASE → all → view & sort table
-	Convert amount → pick target → keypad → OK
-	Settings → change language/source/base

🖼 Screenshots

Place images in docs/screenshots/ and reference here:

Onboarding Table Calculator


🔐 Notes

-	Rotate any previously exposed keys/tokens.
-	Respect currencylayer free‑tier limitations.
-	Scraper may require maintenance if CBR markup changes.

📜 License

GNU Affero General Public License v3 (AGPLv3)

  • ✅ Share and showcase code freely.
  • ✅ Others may learn and contribute.
  • ❌ No one can take it private, build a SaaS on top, and profit without open-sourcing their changes.

About

A multilingual Telegram bot for currency exchange rates, conversions, and financial insights — supports API + CBR data sources.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published