Skip to content

A Telegram bot written in Python that provides real-time currency exchange rates and precious metal prices in Turkish Lira.

License

Notifications You must be signed in to change notification settings

gdagtekin/KurBot

Repository files navigation

KurBot

A Telegram bot written in Python that provides real-time currency exchange rates and precious metal prices in Turkish Lira.

Prerequisites

  • Get yourself a Bot account and a token at Telegram Bots.
  • If you want to run it in Docker ->Docker installed on your system.
  • If you want to run it without Docker -> Python 3.11 or higher.
  • Optional: A server or cloud environment for hosting (e.g., Heroku, AWS, etc.).

Methods to Run the Bot

You have four ways to run this bot:

  1. Run the bot with a pre-built Docker image
  2. Run the bot using Docker Compose
  3. Build the Docker image and run the bot
  4. Run locally without Docker

1. With a pre-built Docker image

You need to provide the following environment variable for the bot to work:

TOKEN: Your Telegram bot token from BotFather.

docker run -d --restart unless-stopped --name currencies -p 8443:8443 -e TOKEN="your-telegram-bot-token" gdagtekin/currency-bot

Check your log

docker logs -f currencies

2. Docker Compose

You need to provide the following environment variable for the bot to work:

TOKEN: Your Telegram bot token from BotFather.

version: '3.9'
services:
  currencies:
    image: gdagtekin/currency-bot:latest
    restart: unless-stopped
    container_name: currencies
    ports:
      - "8443:8443"
    environment:
      - TOKEN=your-telegram-bot-token

Start the bot with Docker Compose

docker-compose up -d

Check your log

docker logs -f currencies

3. Build the Docker image and run the bot

Clone the project

  git clone https://github.com/gdagtekin/KurBot.git

Go to the project directory

  cd KurBot

Build the Docker Image

docker build -t currency-bot .

Run the following command to start the bot in the container

You need to provide the following environment variable for the bot to work:

TOKEN: Your Telegram bot token from BotFather.

Run the Docker Container

docker run -d --restart unless-stopped --name currencies -p 8443:8443 -e TOKEN="your-telegram-bot-token" currency-bot

Check your log

docker logs -f currencies

4. Run locally without Docker

  git clone https://github.com/gdagtekin/KurBot.git

Go to the project directory

  cd KurBot

Install pipenv

  pip install pipenv

Install dependencies

  pipenv install

Replace YOUR-TELEGRAM-BOT-TOKEN in the Const.py file with your Telegram Bot Token.

Start the bot

  python CurrenciesBot.py

Test the Bot

Once the bot is up and running, you can start interacting with it.

Send /start to see a welcome message and /ping to check if the bot is responding.

Commands

  • /start - Get a welcome message with bot instructions.
  • /ping - Check if the bot is running and responding.
  • /dolar - Get the current exchange rate of the US Dollar (USD) to Turkish Lira (TRY).
  • /euro - Get the current exchange rate of the Euro (EUR) to Turkish Lira (TRY).
  • /gramaltin - Get the current price of Gram Altın in Turkish Lira.
  • /ceyrekaltin - Get the current price of Çeyrek Altın in Turkish Lira.
  • /ons - Get the current price of Gold Ounce (ONS) in Turkish Lira.

License

MIT

About

A Telegram bot written in Python that provides real-time currency exchange rates and precious metal prices in Turkish Lira.

Topics

Resources

License

Stars

Watchers

Forks