This is a Telegram bot designed to maintain the owner's anonymity (optional) by forwarding received messages directly to the owner. It also includes additional features such as broadcasting messages to all active users, retrieving user IDs and information, and more. The bot is developed using the python-telegram-bot
library (v21.9).
A simple assistant telegram bot
- This bot can be found as Eva on Telegram.
Looking for Ultimate All-in-one Telegram Bot?
- Checkout tgbot
- Download & rename
sample_config.py
toconfig.py
then fillupconfig.py
file value's
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
SERVER_URL
Remember this needs to be fill up after deployment⚠️ (otherwise bot will goto sleep)
- 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 acluster
- After creating again on the left side list,
Database Access
click onADD NEW DATABASE USER
-
Authentication Method
:Password
-
Password Authentication
: giveusername
andpassword
(remember that) -
on
Database User Privileges
section -
Built-in Role
:Atlas admin
-
Finally click on
Add User
-
Now again goto
cluster
section and click onconnect
-
Connect to your application
sectionDrivers
-
Connecting with MongoDB Driver
section3. Add your connection string into your application code
-
Here you can see something like
mongodb+srv://something:<db_password>@cluster9800.AA11.mongodb.net/?retryWrites=true&w=majority&appName=Cluster9800
-
Remove the
<db_password>
from that URI and add your password which one you gave on2. '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 onADD IP ADDRESS
and set ip to0.0.0.0/0
(Its important to access database without network restriction)
----- Windows -----
- Required
python 3.11
or later - Open
assistant-tgbot
directory on cmd - Run on cmd
pip install -r requirements.txt
- Finally
python main.py
----- Linux -----
- Required
python 3.11
or later - Open
assistant-tgbot
directory on shell - Run on shell
pip install -r requirements.txt
- Finally
python main.py
-
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.py'
> File Contents: paste all content from 'sample_config.py' (make sure you filled up everything)
Note: If you face anyproblem accessing
Advanced option
then just click onCreate Web Service
then fromEnvironment
>Secret Files
add theconfig.py
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
Environment
on the left side list thenSecret Files
section andEdit
theSERVER_URL
with your service url. (So that bot won't go to sleep)
D.O.N.E 🥳
GPL-3.0
Original Creator - @bishalqx980
𝓐 𝓹𝓻𝓸𝓳𝓮𝓬𝓽 𝓸𝓯
▄▄▄▄ ██▓ ██████ ██░ ██ ▄▄▄ ██▓
▓█████▄ ▓██▒▒██ ▒ ▓██░ ██▒▒████▄ ▓██▒
▒██▒ ▄██▒██▒░ ▓██▄ ▒██▀▀██░▒██ ▀█▄ ▒██░
▒██░█▀ ░██░ ▒ ██▒░▓█ ░██ ░██▄▄▄▄██ ▒██░
░▓█ ▀█▓░██░▒██████▒▒░▓█▒░██▓ ▓█ ▓██▒░██████▒
░▒▓███▀▒░▓ ▒ ▒▓▒ ▒ ░ ▒ ░░▒░▒ ▒▒ ▓▒█░░ ▒░▓ ░
▒░▒ ░ ▒ ░░ ░▒ ░ ░ ▒ ░▒░ ░ ▒ ▒▒ ░░ ░ ▒ ░
░ ░ ▒ ░░ ░ ░ ░ ░░ ░ ░ ▒ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░
based on python-telegram-bot lib