Create Your Own Telegram Bot In Python 3.10 Tutorial (Works With Groups)
Vložit
- čas přidán 25. 07. 2024
- Learn how you can create your very own Telegram bot with Python 3.10 in 2022. We will also be covering how to make sure the bot responds in group chats, and how you can freely customise it.
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels
00:00 Bot Preview
01:15 Bot Father Setup
05:00 Writing the code
12:10 Running the bot
Wow! Thank you for the video, helped with understanding this library
hi! thank you for a very nice toturial
however i am running against an error.
its about your code at line 65
updater = Updater(keys.token, use_context=True)
it says ; NameError: name 'Updater' is not defined
how can i fix this ?
Thanks a lot bro helped me
cool stuff dude ;)
Hi, Thank you very much for the tutorial, am really appreciate your efforts, i have a request to make, i have a website and when user asks something is it possible to search that term on website and send user that searched link?? This even helps to others who want to display google search results, Thank you
Sir i need to run my chat bot with a dynamic dataset could you recommend me anything for knowing how to make it?
Can you make a video on how to setup webhook, deploy as web application on pythonanywhere using flask module?
how can we make the bot create quiz for new members before they join, and submit their info ?
I had just finished your telegram bot playlist. And now this amazing tutorial 🤩🤩 Sir, your channel benefits me a lot. You deserve more subscribers. Will try to share your content as much as possible 🤩
Thank you!
Share Telegram channel
@@thewise482
I can't find link. Please send here ser
Buddy can you make a video on how to create a group management bot having this additional function
def handle_response(text: str) -> str:
i cant get this line to work in groups, only direct with the bot. any ideas?
Hello. Can you help me please? in my code it says: " TypeError: Updater.__init__() got an unexpected keyword argument 'use_context'." I upgraded the python version, but the problem still exists.
I have the same exact problem and i don't know what to do, did you find the solution?
@@MehrunesKar No mate. Wish I could
@@mtvtvyo No worries, i've found the solution. Typing ( pip install python-telegram-bot==13.7 ) in Terminal solves the problem, now the bot runs properly. It seems the updated version of the package is not compatible with the codes in the video, but the 13.7 one is, hope this helps whoever stumbles upon our comments
@@MehrunesKar thank you. it helped me
@@MehrunesKar thx
Excellent video! I did notice that the bot did not respond to messages if the message _type == 'group. Setting that to != 'group' got the responses to display in telegram. I may not understand using groups in that context.
Wow thanks for this!
How do I run a local bot api server on windows?
Thanks
Working
What is the code to mute / ban users if 'xxxxxx' in text ?
mine is not giving back the responses😿.......what might be the problem??
Is it possible to send files using this code?
I've checked, have helped me a lot. Just a little question, what is the equivalent of update.message.reply_text for photos?
send_photo
i keep getting ModuleNotFoundError: No module named 'telegram' ..any help please ...im using python 3.11
Yo bro how can we setcommand with python
when i type in hello in telegram the bot doesn''t respond
hey man! great video! im having an issue with de def handle response, i have a few auto replies set up,
def handle_response(text: str) -> str:
if 'gm' in text:
return 'or GN, where ever you are!'
if 'trust no one, trust code' in text:
return 'long live defi!'
return ''
i think because its left blank, every message that is sent in a gorup is printing an error ( caused error: Message text is empty)
anyway to fix this?
on further investigation, i think the issue is being caused by it being a super group...?
the error log pings with every message (message text is empty)
@@AdamYarcohey, did you firgure this out?
well explained,but
I'm getting a error.It says
" 'Update' object has no attribute named 'chat' "
any idea how to fix it?
It is Updater, probably you missed the letter 'r'
cannot import name 'Animation' from 'telegram'
hi , what's the app or software that you are using in 5:00 ?
It's PyCharm
Quick question I'm a novice when it comes to programing so do I need to turn on my network wifi to my computer when I'm creating this code???
Wifi is required as this works in sync with the bot
Wifi is required as this works in sync with the bot
Guys, does this bot work only on our local machine? What are the ways to make it work globally?
You have to run the python script on any machine that runs 24x7, which could be a VPS (virtual private server) or home raspberrypi.
Just so u know when u run the script in ur local machine, it is already global, u just need to run it 24/7
is it possible if 1 bot token can be used on many computers?
You can try
Great vid thanks but its no longer working.
code is not working
does this work for both supergroups and normal groups
I can’t say, I don’t know what a supergroup is
@@Indently it's ok I got my answer, it does. a supergroup is a public group that can have up to 100,000 members
ITT:
1 guy: thanks so much, it work, you are a great teacher
100 recent comments:
doesnt work
doesnt work
doesnt work
doesnt work
wtf happens in 1 year with that package?
How to run it 24/7?
u rent a virtual private server, or run it on a raspberry pi
I keep getting keys not defined
We’re sorry to hear that you’re facing trouble with this tutorial. We have some recommendations for you.
- First, try watching the tutorial again to check if you missed something (remember that programming languages are strict, and that uppercase & lowercase characters are completely different.)
- Second, if you’re facing an error, try copying and pasting it into the Google search engine, it’s the fastest way to find the best response for the issue you are facing.
- Third, if it’s still too confusing for you, try taking a step back and working on an easier project to try to improve your programming skills before tackling the project in this video.
We wish you the best of luck with your project!
Why don't you use pyrogram or telethon
Share the pros and cons of both and others might learn from your comment 💪
I write down all the code line by line but its not working.
try again
@@Indently lol
next please send to channel
I still get the error: #Unresolved reference 'Filters'#. Does this effect my code, because my bot runs after installing an older version of the library? THX very much in advance!
Hey there! I will have an updated version of this tutorial up on my channel real soon. I see they performed a lot of updates since the last time I checked.
@@Indently nice, appreciate that so much💯🤝🏼
you teach too fast
Thanks!
Update.dispatcher is giving me errors, what do I do?
My lib v20a0 seems incompatible with the videos I’ve watched so far
Perhaps try using a different library if nothing else works.
Did you fix it? I need help too
@@michaeIbonq I used a different library....pyTelegrambot
@@Frankywalterlewiston thanks for responding. I did the same
I'm having problems with my line
Print (f'user ({update.message.chat.id}) says: " {text} in: {message_type}"'
Check your qoutes