/tgbot

This Telegram bot, built with the python-telegram-bot library, efficiently manages groups and performs various tasks on Telegram.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

This Telegram bot is built using the python-telegram-bot library version 21.9 and performs various tasks within Telegram.

If you liked this project then please give it a ⭐

🎃 Features 🎃

  • 🔰 Note (14/12/2024): Certain features have been temporarily removed due to limitations. They may be reintroduced in future updates. Additionally, not all features are listed here. We encourage you to start the bot and explore its full functionality. Thank you for your understanding.

  • Group Management 🛠️

    • It has just everything...
  • AI 🤖

    • ChatGPT
    • AI photo imagine Removed due to limitations
  • Misc 🎁

    • Get any movie info
    • Translate any language
    • Decode, Encode (base64)
    • Short any url
    • Ping any url
    • Calculate basic math
    • Take webshot (website screenshot) Removed due to limitations
    • Get any location weather info
    • Download YouTube video Removed due to limitations
    • Search YouTube video Removed due to limitations
    • Generate QR code (image)
    • Convert image into a link (public)
    • Convert text into a link
    • Whisper user in group chat (secret message)
    • Search games link for PS3 & other consoles
    • Much more... Start now to see 👀

ℹ️ Todo: add more features... 🎉

• • • • • • • • • • • • • • • • • • • •

How to deploy 🚀

Setup 📦

  • Download & rename sample_config.env to config.env then fillup config.env file value's
⚠️ Don't share or upload the `config.env` any public place or repository
  • BOT_TOKEN Get from https://t.me/BotFather E.g. 123456:abcdefGHIJK...
  • OWNER_ID Get from bot by /id command E.g. 2134776547
  • OWNER_USERNAME Your Username E.g. paste like ✅ bishalqx980 not ❌ @bishalqx980
  • MONGODB_URI Get from https://www.mongodb.com/ (Check Below for instruction)
  • DB_NAME anything E.g. MissCiri_db

Creating MongoDB URI

  • Signin/Signup on MongoDB
  • on MongoDB Atlas create New Project
  • After creating click on the project to access
  • on the left side list, click on Clusters > create a cluster
  • After creating again on the left side list, Database Access click on ADD NEW DATABASE USER
  1. Authentication Method: Password

  2. Password Authentication: give username and password (remember that)

  3. on Database User Privileges section

  4. Built-in Role: Atlas admin

  5. Finally click on Add User

  6. Now again goto cluster section and click on connect

  7. Connect to your application section Drivers

  8. Connecting with MongoDB Driver section 3. Add your connection string into your application code

  9. Here you can see something like mongodb+srv://something:<db_password>@cluster9800.AA11.mongodb.net/?retryWrites=true&w=majority&appName=Cluster9800

  10. Remove the <db_password> from that URI and add your password which one you gave on 2. 'Password Authentication'

🥳 Done you have created your MongoDB_URI successfully...

Note: One last thing, on the left side list click on Network Access section click on ADD IP ADDRESS and set ip to 0.0.0.0/0 (Its important to access database without network restriction)

Deploy Section 🎯

🖥️ Local deploy

----- Windows -----

  • Required python 3.11 or later
  • Open tgbot directory on cmd
  • Run on cmd pip install -r requirements.txt
  • Finally python main.py

----- Linux -----

  • Required python 3.11 or later
  • Open tgbot directory on shell
  • Run on shell pip install -r requirements.txt
  • Finally python main.py

📡 Render deploy

  • Signin/Signup on Render

  • Goto dashboard & create a New Web Service

  • Select Public Git repository > https://github.com/bishalqx980/tgbot

  • Then 👇

> Language: Docker
> Branch: main
> Instance Type: Free [or paid]
  • Advanced option 👇
> Secret Files ⬇️
> Filename: 'config.env'
> File Contents: paste all content from 'sample_config.env' (make sure you filled up everything)

Note: If you face anyproblem accessing Advanced option then just click on Create Web Service then from Environment > Secret Files add the config.env values. Then restart/redeploy the web service.

Important: After deployment complete go to Render Dashboard and open your service then you can see service url on top left corner https://example.onrender.com copy that and go to bot /bsettings server url and edit with your service url. (So that bot won't go to sleep)

D.O.N.E 🥳

📡 Heroku deploy

  • Signin/Signup on http://heroku.com/
  • Give a ⭐ and fork this repo https://github.com/bishalqx980/tgbot
  • Goto your forked repo settings > General > Check ✅ Template repository
  • Come back and on the right top corner you will see a green button name Use this template , click on that and create a new private repo with these files
  • On that private repo upload your config.env file and make sure required all values are filled up
  • Then goto the private repo settings > secrets and variables > Actions
  • Click on New respository secret
    • Name: HEROKU_EMAIL
    • Secret: your_heroku_email
    • Repeat the step and add HEROKU_APP_NAME - unique name eg. tgbot007oc-bishalqx980
    • Add HEROKU_API_KEY - get from https://dashboard.heroku.com/account scroll down API Key click on Reveal button then copy the value and paste it...
  • Finally click on Actions tab from the top, select Deploy to heroku, on right side click on Run workflow > green button Run workflow
  • Now wait for deployment complete... (you can check log here https://dashboard.heroku.com/apps/HEROKU_APP_NAME/logs)
  • ⚠️ Add Server url from /bsettings before heroku shutdown... then restart dyno (heroku app)

D.O.N.E 🥳

  • After deployment complete, don't forget to visit /bsettings

License 📝

GPL-3.0


Original Creator - @bishalqx980

𝓐 𝓹𝓻𝓸𝓳𝓮𝓬𝓽 𝓸𝓯

 ▄▄▄▄    ██▓  ██████  ██░ ██  ▄▄▄       ██▓    
▓█████▄ ▓██▒▒██    ▒ ▓██░ ██▒▒████▄    ▓██▒    
▒██▒ ▄██▒██▒░ ▓██▄   ▒██▀▀██░▒██  ▀█▄  ▒██░    
▒██░█▀  ░██░  ▒   ██▒░▓█ ░██ ░██▄▄▄▄██ ▒██░    
░▓█  ▀█▓░██░▒██████▒▒░▓█▒░██▓ ▓█   ▓██▒░██████▒
░▒▓███▀▒░▓  ▒ ▒▓▒ ▒ ░ ▒ ░░▒░▒ ▒▒   ▓▒█░░ ▒░▓  ░
▒░▒   ░  ▒ ░░ ░▒  ░ ░ ▒ ░▒░ ░  ▒   ▒▒ ░░ ░ ▒  ░
 ░    ░  ▒ ░░  ░  ░   ░  ░░ ░  ░   ▒     ░ ░   
 ░       ░        ░   ░  ░  ░      ░  ░    ░  ░
      ░                                        
                            based on python-telegram-bot lib