Create Your Own Telegram Bot In Python 3.10 Tutorial (Works With Groups)

Sdílet
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

Komentáře • 78

  • @cama8284
    @cama8284 Před rokem

    Wow! Thank you for the video, helped with understanding this library

  • @hatseflats91
    @hatseflats91 Před rokem +3

    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 ?

  • @rkrockzgameplay3578
    @rkrockzgameplay3578 Před rokem

    Thanks a lot bro helped me

  • @TeeChemist
    @TeeChemist Před rokem

    cool stuff dude ;)

  • @iasmaterials1207
    @iasmaterials1207 Před rokem

    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

  • @rohanrajpasupunoori5072

    Sir i need to run my chat bot with a dynamic dataset could you recommend me anything for knowing how to make it?

  • @mamidalaramu7059
    @mamidalaramu7059 Před rokem

    Can you make a video on how to setup webhook, deploy as web application on pythonanywhere using flask module?

  • @habeshaman6469
    @habeshaman6469 Před rokem

    how can we make the bot create quiz for new members before they join, and submit their info ?

  • @costube9574
    @costube9574 Před 2 lety +2

    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 🤩

  • @AdityaSingh-hr9gv
    @AdityaSingh-hr9gv Před rokem

    Buddy can you make a video on how to create a group management bot having this additional function

  • @AdamYarco
    @AdamYarco Před rokem

    def handle_response(text: str) -> str:
    i cant get this line to work in groups, only direct with the bot. any ideas?

  • @mtvtvyo
    @mtvtvyo Před rokem +12

    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.

    • @MehrunesKar
      @MehrunesKar Před rokem +1

      I have the same exact problem and i don't know what to do, did you find the solution?

    • @mtvtvyo
      @mtvtvyo Před rokem

      @@MehrunesKar No mate. Wish I could

    • @MehrunesKar
      @MehrunesKar Před rokem +6

      @@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

    • @morrischoga1581
      @morrischoga1581 Před rokem +2

      @@MehrunesKar thank you. it helped me

    • @pokemontrainer166
      @pokemontrainer166 Před rokem +1

      ​@@MehrunesKar thx

  • @daveoeste
    @daveoeste Před rokem +2

    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.

    • @smf5769
      @smf5769 Před rokem

      Wow thanks for this!

  • @ianrudey3124
    @ianrudey3124 Před rokem

    How do I run a local bot api server on windows?

  • @pokemontrainer166
    @pokemontrainer166 Před rokem

    Thanks
    Working

  • @Sean-jh7op
    @Sean-jh7op Před 2 lety

    What is the code to mute / ban users if 'xxxxxx' in text ?

  • @velazreagan3487
    @velazreagan3487 Před rokem

    mine is not giving back the responses😿.......what might be the problem??

  • @pokemontrainer166
    @pokemontrainer166 Před rokem

    Is it possible to send files using this code?

  • @ainanirina758
    @ainanirina758 Před rokem

    I've checked, have helped me a lot. Just a little question, what is the equivalent of update.message.reply_text for photos?

  • @paw_maintenance8167
    @paw_maintenance8167 Před rokem

    i keep getting ModuleNotFoundError: No module named 'telegram' ..any help please ...im using python 3.11

  • @grandlibulu3701
    @grandlibulu3701 Před rokem

    Yo bro how can we setcommand with python

  • @flamethekid
    @flamethekid Před rokem

    when i type in hello in telegram the bot doesn''t respond

  • @AdamYarco
    @AdamYarco Před rokem +2

    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?

    • @AdamYarco
      @AdamYarco Před rokem

      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)

    • @smf5769
      @smf5769 Před rokem

      @@AdamYarcohey, did you firgure this out?

  • @arkarwine6465
    @arkarwine6465 Před rokem

    well explained,but
    I'm getting a error.It says
    " 'Update' object has no attribute named 'chat' "
    any idea how to fix it?

    • @mrmahonrie
      @mrmahonrie Před rokem

      It is Updater, probably you missed the letter 'r'

  • @makedifferenteverything1092

    cannot import name 'Animation' from 'telegram'

  • @jarryl02
    @jarryl02 Před rokem

    hi , what's the app or software that you are using in 5:00 ?

  • @bensonadeyemishowole6724

    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???

    • @Ozodbe-if1so
      @Ozodbe-if1so Před 23 dny

      Wifi is required as this works in sync with the bot

    • @Ozodbe-if1so
      @Ozodbe-if1so Před 23 dny

      Wifi is required as this works in sync with the bot

  • @Zohrabzeynalli
    @Zohrabzeynalli Před rokem

    Guys, does this bot work only on our local machine? What are the ways to make it work globally?

    • @TeeChemist
      @TeeChemist Před rokem +2

      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

  • @Nexus_Programming
    @Nexus_Programming Před rokem

    is it possible if 1 bot token can be used on many computers?

  • @dazeb
    @dazeb Před rokem

    Great vid thanks but its no longer working.

  • @amitnanda8444
    @amitnanda8444 Před rokem

    code is not working

  • @io-nj2dk
    @io-nj2dk Před rokem

    does this work for both supergroups and normal groups

    • @Indently
      @Indently  Před rokem

      I can’t say, I don’t know what a supergroup is

    • @io-nj2dk
      @io-nj2dk Před rokem

      @@Indently it's ok I got my answer, it does. a supergroup is a public group that can have up to 100,000 members

  • @gabrieldomingues9202
    @gabrieldomingues9202 Před rokem

    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?

  • @Aditya-zx1nv
    @Aditya-zx1nv Před rokem

    How to run it 24/7?

    • @TeeChemist
      @TeeChemist Před rokem

      u rent a virtual private server, or run it on a raspberry pi

  • @kia4now
    @kia4now Před rokem

    I keep getting keys not defined

    • @Indently
      @Indently  Před rokem

      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!

  • @memoking34
    @memoking34 Před rokem +1

    Why don't you use pyrogram or telethon

    • @Indently
      @Indently  Před rokem

      Share the pros and cons of both and others might learn from your comment 💪

  • @backtocoding6007
    @backtocoding6007 Před rokem

    I write down all the code line by line but its not working.

  • @edinetgrunhed6000
    @edinetgrunhed6000 Před rokem

    next please send to channel

  • @eigen_art_ich
    @eigen_art_ich Před rokem

    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!

    • @Indently
      @Indently  Před rokem +1

      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.

    • @eigen_art_ich
      @eigen_art_ich Před rokem

      @@Indently nice, appreciate that so much💯🤝🏼

  • @brookayanaw9540
    @brookayanaw9540 Před rokem

    you teach too fast

  • @Frankywalterlewiston
    @Frankywalterlewiston Před 2 lety

    Update.dispatcher is giving me errors, what do I do?
    My lib v20a0 seems incompatible with the videos I’ve watched so far

    • @Indently
      @Indently  Před 2 lety

      Perhaps try using a different library if nothing else works.

    • @michaeIbonq
      @michaeIbonq Před rokem

      Did you fix it? I need help too

    • @Frankywalterlewiston
      @Frankywalterlewiston Před rokem +1

      @@michaeIbonq I used a different library....pyTelegrambot

    • @michaeIbonq
      @michaeIbonq Před rokem

      @@Frankywalterlewiston thanks for responding. I did the same

  • @BPK910PLAYZ
    @BPK910PLAYZ Před rokem

    I'm having problems with my line
    Print (f'user ({update.message.chat.id}) says: " {text} in: {message_type}"'