{"id":27122342,"url":"https://github.com/l1ve4code/telegram-card-bot","last_synced_at":"2025-06-13T06:08:33.852Z","repository":{"id":282901150,"uuid":"938939042","full_name":"l1ve4code/telegram-card-bot","owner":"l1ve4code","description":"Facilitate the exchange of discount cards between users via a Telegram bot.","archived":false,"fork":false,"pushed_at":"2025-06-11T18:53:07.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T06:08:16.508Z","etag":null,"topics":["deepseek","docker-compose","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/l1ve4code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-25T18:28:13.000Z","updated_at":"2025-06-11T18:53:11.000Z","dependencies_parsed_at":"2025-04-07T11:36:11.959Z","dependency_job_id":"f684de08-9e1e-4cc4-87bb-ec7fdd0db160","html_url":"https://github.com/l1ve4code/telegram-card-bot","commit_stats":null,"previous_names":["l1ve4code/telegram-card-bot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/l1ve4code/telegram-card-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1ve4code%2Ftelegram-card-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1ve4code%2Ftelegram-card-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1ve4code%2Ftelegram-card-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1ve4code%2Ftelegram-card-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/l1ve4code","download_url":"https://codeload.github.com/l1ve4code/telegram-card-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/l1ve4code%2Ftelegram-card-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259592272,"owners_count":22881268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deepseek","docker-compose","telegram-bot"],"created_at":"2025-04-07T11:36:00.089Z","updated_at":"2025-06-13T06:08:33.832Z","avatar_url":"https://github.com/l1ve4code.png","language":"Python","readme":"# telegram-card-bot\n\n## About\n\n- **Purpose**: Facilitate the exchange of discount cards between users via a Telegram bot.\n- **Key Features**:\n  - Users can upload a photo of their discount card and assign it a unique name.\n  - Other users can browse available cards and download them.\n  - Cards are stored securely in a SQLite database.\n  - Easy-to-use interface with inline buttons for card selection.\n\n### Technologies\n\n* Language: **Python**\n* Libraries: **python-telegram-bot, SQLite3**\n* Database: **SQLite**\n* Deployment: **Docker, Docker Compose**\n* API: **Telegram Bot API**\n\n## Installing\n\n### Clone the Project\n\n```shell\ngit clone https://github.com/l1ve4code/telegram-card-bot.git\n```\n\n### Set Your Values in `docker-compose.yml`\n\nReplace the placeholder with your Telegram Bot token:\n\n```yaml\nservices:\n  discount-card-bot:\n    container_name: discount-card-bot\n    build: .\n    network_mode: host\n    environment:\n      - BOT_TOKEN=YOUR_BOT_TOKEN\n      - ADMIN_PASSWORD=your_admin_password\n    volumes:\n      - ./photos:/app/photos\n      - ./discount_cards.db:/app/discount_cards.db\n    restart: unless-stopped\n```\n\n### Replace Placeholders in the Script\n\nIf you're not using Docker, update the following variable in the script (`main.py`):\n\n```python\napplication = Application.builder().token(\"BOT_TOKEN\").build()\n```\n\n## Running the Project\n\n### Using Docker Compose\n\n1. Build and start the container:\n\n```shell\ndocker-compose up --build\n```\n\n2. Stop the container:\n\n```shell\ndocker-compose down\n```\n\n### Running Locally\n\n1. Install dependencies:\n\n```shell\npip install -r requirements.txt\n```\n\n2. Run the script:\n\n```shell\npython main.py\n```\n\n## How It Works\n\n1. **Uploading a Discount Card**:\n   - Users send a photo of their discount card to the bot.\n   - The bot saves the photo with a unique filename (using a timestamp) and prompts the user to assign a name to the card.\n   - The card's name and file path are stored in the SQLite database.\n\n2. **Browsing Available Cards**:\n   - Users can use the `/list` command to view all available cards.\n   - The bot displays a list of cards with inline buttons for selection.\n\n3. **Downloading a Card**:\n   - When a user selects a card from the list, the bot sends the corresponding photo.\n\n4. **Persistent Storage**:\n   - The SQLite database (`discount_cards.db`) stores all card information, ensuring data persistence even after the bot is restarted.\n\n## Author\n\n* Telegram: **[@live4code](https://t.me/live4code)**\n* Email: **steven.marelly@gmail.com**\n\nGood luck with your Telegram discount card exchange bot! 🚀","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1ve4code%2Ftelegram-card-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl1ve4code%2Ftelegram-card-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1ve4code%2Ftelegram-card-bot/lists"}