How To Create A Telegram Bot In Python For Beginners (2023 Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

ความคิดเห็น • 294

  • @moharrammoharrami3957
    @moharrammoharrami3957 ปีที่แล้ว +69

    Thanks, today was my off day and I randomly found this video. First I made this exactly as you taught, then I changed stuff and learned more about python (I'm a JS developer). Best way for a software developer to spend his off day :)

  • @auroram4936
    @auroram4936 9 หลายเดือนก่อน +6

    thank you so much for this clear, easy to follow tutorial!! you saved my project

  • @jonnywoo8418
    @jonnywoo8418 ปีที่แล้ว +5

    Finally Latest version video! Thanks!

  • @qwert4871
    @qwert4871 ปีที่แล้ว +7

    Great tutorial! There's one thing I want to add though. Your implementation of error handler lacks information on a line of the problem. After passing around with GPT-4 for a while I found a solution to get more information:
    ```python
    async def error(update: Update, context: ContextTypes.DEFAULT_TYPE):
    _, _, tb = sys.exc_info()
    line_number = traceback.extract_tb(tb)[-1][1]
    exc_type, exc_value, exc_traceback = sys.exc_info()
    error_traceback = traceback.format_exception(exc_type, exc_value, exc_traceback)
    print(f"Update {update} caused error {context.error}:
    {''.join(error_traceback)}")
    ```

  • @humadi2001
    @humadi2001 ปีที่แล้ว +4

    I keep coming to your source code several times. Keep it up!

  • @parsahosseini4241
    @parsahosseini4241 6 หลายเดือนก่อน +3

    Clear, to the point, no bs, clean code and understandable instructions.
    This man got himself my respect ❤
    Thanks a lot for this quality content mate.

  • @strycinek
    @strycinek ปีที่แล้ว +12

    Excellent video man, it was exactly what I need to create my own simple bot

  • @yashchatt5754
    @yashchatt5754 7 หลายเดือนก่อน +4

    Was searching for updated vid! This helps a lot

  • @worldofelectronicsandprogr1128
    @worldofelectronicsandprogr1128 ปีที่แล้ว +17

    Awesome tutorial!! ☺☺ I've managed to make my first chat box watching this great and simple video! Many thanks! 👏👏🙏🙏 You are a great tutor and you explain very well the concepts! 👍👍Keep up the good work!!!! ☺☺🙏🙏

  • @xasaninomov1453
    @xasaninomov1453 ปีที่แล้ว +1

    Thank you, very much I am so exited that my bot is actually working

  • @arsalanshafiq9260
    @arsalanshafiq9260 ปีที่แล้ว +1

    Really like your accent and sense of humour

  • @sen4674
    @sen4674 ปีที่แล้ว +3

    Thanks, I just successfully made my first Telegram bot.

  • @lucasputz4475
    @lucasputz4475 7 หลายเดือนก่อน +1

    i love your descriptions like "we'll need a command handler that is handling the commands". you could have just published your code with explanations like that

    • @Indently
      @Indently  7 หลายเดือนก่อน +2

      I make myself laugh sometimes

  • @ezekiel543
    @ezekiel543 5 หลายเดือนก่อน

    This video is very good and the best I found on creating a Telegram bot with Python. Its super easy to understand and follow along.

  • @mlindatech
    @mlindatech 11 หลายเดือนก่อน

    Great at first this thing did not work but after revisiting my code it worked

  • @charleshu8041
    @charleshu8041 ปีที่แล้ว +1

    it's amazing I followed your video did the same and it works and running well in my local PC, this my first time learn Python!! thank you so much!!! can you also make another video to show how to deploy these codes to Lambda? One thousand thanks to you🎉❤

  • @chris-mq8rv
    @chris-mq8rv 11 หลายเดือนก่อน +1

    great walkthrough, and explanations along the way. Thanks man.

  • @maryamfaaramarzi
    @maryamfaaramarzi 10 หลายเดือนก่อน

    Hello, you are great, I like your teaching very much. Why didn't you post more video for telegram bot in python?

  • @hazza6208
    @hazza6208 11 หลายเดือนก่อน +1

    It worked for me. Thank you for the wonderful content. I hope you can explain to us how to put all the languages in artificial intelligence

    • @2mat012
      @2mat012 10 หลายเดือนก่อน +1

      can you share the code

  • @ManojKumar-yy7yl
    @ManojKumar-yy7yl 3 หลายเดือนก่อน +5

    am I need to keep the python script always in running state for access for BOT?

  • @systemkey1
    @systemkey1 8 หลายเดือนก่อน

    very excellent video my brother keep up the good work.

  • @OluwasegunJoshua-f2e
    @OluwasegunJoshua-f2e หลายเดือนก่อน

    Thanks man😊. You got a follower 👍

  • @mayorc
    @mayorc ปีที่แล้ว +2

    Can you make a video for the updated workflow for telegram bots using login credentials, two factors authentication using OTP, and ConversationHandler using multiple STATES?

  • @Aditya_1950
    @Aditya_1950 10 หลายเดือนก่อน

    Thanks brother. It working. Very informative tutorial 👍

  • @nemira_oni590
    @nemira_oni590 ปีที่แล้ว

    thanks, just inserted my token and bot name and it works!

  • @ramsidharth2931
    @ramsidharth2931 9 หลายเดือนก่อน

    Finally got a legitimate code that would work !

  • @KINGHACK_1XBET1
    @KINGHACK_1XBET1 8 หลายเดือนก่อน

    Love the video it amazing 😍

  • @deep_singh01
    @deep_singh01 10 หลายเดือนก่อน

    Superb Video 🤟🤟
    But Can you please help in building chatbot that answer any question or query automatically in this manner?

  • @bhai431
    @bhai431 9 หลายเดือนก่อน +2

    4:59 how to open this window, *PLEASE SOMEONE HELP*

  • @Nemo7The7Pirate7
    @Nemo7The7Pirate7 2 หลายเดือนก่อน

    i'm instantly sold on this guide after the banana banana bit.

  • @walidmat8972
    @walidmat8972 ปีที่แล้ว +2

    pleas how can i make the bot respond with a video like a tutorial to use the bot ? and how to host the bot on aserver ? thnx

  • @Juan-wg4gy
    @Juan-wg4gy ปีที่แล้ว +3

    Hi, how are you?. When I run all the telegram libraries, such as: Filters, it returns me that it is not compatible with version 3.11 of python. But from what I see you are using 3.11, what could be the reason that throws me that error?

  • @alexandrkardash6594
    @alexandrkardash6594 7 หลายเดือนก่อน

    Thank you for tutorial. Just wonder if you familiar with telegram payments platform? Hopefully you'll find this topic interesting and create amazing short tutorial for that. Thanks you for your work

  • @khoanguyentrader_official
    @khoanguyentrader_official ปีที่แล้ว

    Thank you so much, i learn and make it successfully. 😍😘

  • @spryzenthehonerone
    @spryzenthehonerone ปีที่แล้ว

    thanks for sharing your knowledge

  • @Paperella-dd2cg
    @Paperella-dd2cg 11 วันที่ผ่านมา +1

    what pytho software does he use??

  • @ChanXueLi
    @ChanXueLi ปีที่แล้ว +3

    hi! i have this error when i sent 'how are you' to my telebot and it doesn't give me any response as it should written in the code:
    case error check_update() missing 1 required positional argument: 'update'
    but i don't see any check_update() in the code, so i assume is probably because of the library, can someone explain to me the error and how i can debug this error?

    • @seyftech2780
      @seyftech2780 9 หลายเดือนก่อน

      I also face this error. how can I solve it. please?

  • @YHVB1
    @YHVB1 ปีที่แล้ว

    Very informative video, Thank you!

  • @sifiso89
    @sifiso89 ปีที่แล้ว

    BROOOOOOOOOOOOOOOOOOOOOOOO
    thanks a million 🇿🇦

  • @Alexos92
    @Alexos92 ปีที่แล้ว +1

    Amazing video, really great way to get started on a bot project :)
    You cast all your variables into a type. This is not very common in python no ? Will the code work without it ? Thanks for your work !!

    • @whistleblower66
      @whistleblower66 11 หลายเดือนก่อน

      Yes, it will work but I find it's a good practice, in general.

  • @ledigdev
    @ledigdev 4 หลายเดือนก่อน

    Great Video

  • @touhami_dz6458
    @touhami_dz6458 9 หลายเดือนก่อน

    what wallpaper are you using on ur desktop ? i like it

  • @scotter
    @scotter ปีที่แล้ว +1

    Thanks for this! I got it working the first time. THANK YOU! Wondering if you can help with one issue: In supergroups it responds to everyone. I tried merely adding "or 'supergroup' in ..." but that didn't work. Also, issues getting user id or username. Telegram's page on their API is either old or just difficult for me to figure out. Any help welcome!

  • @hicamajig
    @hicamajig ปีที่แล้ว

    Very good overview. Thanks for this!

  • @夜染-x3h
    @夜染-x3h ปีที่แล้ว

    thanks for you,you are greate developer.

  • @__mmars
    @__mmars 5 หลายเดือนก่อน

    you're an angel!!!!!!!!!! tysmmm

  • @hixidom2274
    @hixidom2274 หลายเดือนก่อน

    Pretty cool tutorial. Is typing necessary or just good practice?

    • @grawe687
      @grawe687 หลายเดือนก่อน

      Just good practice, it's mainly so that other people that read the code don't have to guess the type of a variable/constant.

  • @joshitoshi9835
    @joshitoshi9835 ปีที่แล้ว +1

    Thanks for the tut but plz teach us with more details about the api, like why we are using or calling this and that function. Plus how can we restrcit access to some users only? like i want 5 people to use the bot only.
    Also teach us how to convert any python script to telegram bot. Thanks

  • @chaitanyaunavane5819
    @chaitanyaunavane5819 ปีที่แล้ว

    thank you for the updated video! very helpful

  • @mhamadnazm7588
    @mhamadnazm7588 ปีที่แล้ว

    Great tutorial

  • @adeola1183
    @adeola1183 ปีที่แล้ว +1

    Great video. How would I make one command randomly generate a predefined number of responses?

  • @Brandon_AppalachiaEnergy
    @Brandon_AppalachiaEnergy ปีที่แล้ว

    Do you do custom bot builds? I am definitely not this savvy with computers!

  • @42_14.
    @42_14. 6 วันที่ผ่านมา

    Hey! thanks for this video! is it possible to do a bot answering in my place to a private conversation with an another telegram bot? (not mine)

  • @WelfredAlmiron
    @WelfredAlmiron ปีที่แล้ว

    cool video)

  • @bojaka
    @bojaka 11 หลายเดือนก่อน

    If your bot cannot receive messages from the group, please go to the bot's father to set /setprivacy to Disable.

  • @sllakshancc
    @sllakshancc ปีที่แล้ว

    Great video. Thank you.

  • @sherminatorhd318
    @sherminatorhd318 ปีที่แล้ว

    hey man great video, any idea on any platform recommended to run the bot?

  • @sudharsandas5779
    @sudharsandas5779 ปีที่แล้ว +1

    Is the explicit typing necessary in Python? Why is he doing this?

  • @kamilkoterba9368
    @kamilkoterba9368 ปีที่แล้ว +1

    Hey man im pretty Newbie to programming, what i must do to have Python set up like You? As i download it and it doesent look the same the tabs below and the line numbers, Cheers!

    • @megalonightmare
      @megalonightmare 7 หลายเดือนก่อน +1

      because he used pycharm

  • @shrill_kill9929
    @shrill_kill9929 ปีที่แล้ว +2

    What is the "->" part called in python and how does it work?

    • @Indently
      @Indently  ปีที่แล้ว +2

      They're called ligatures: th-cam.com/video/gcsBlLqWIzo/w-d-xo.html&ab_channel=Indently

  • @khoreugene3060
    @khoreugene3060 ปีที่แล้ว +1

    Hi, i love you videos, can you do one that integrate sending photos from certain url once you do a command? and also do one video with inlinekeyboard?

  • @sjukastehumorn35
    @sjukastehumorn35 10 หลายเดือนก่อน +1

    I do not understand what you did at 13:43 I wrote if __name__ == '__main__': but how did you do that blue stuff that covers all text.

    • @moh_zoro_luffy
      @moh_zoro_luffy 9 หลายเดือนก่อน

      So listen to the I main...... I'm not gonna write it all anyway
      He made it a function basically make a key word that triggers a big sentence so when he typed "main" it trigger the long sentence I main....... or as we call it a function

  • @katwokalong
    @katwokalong 4 หลายเดือนก่อน +1

    OK does anyone know how to do the arrow command @ 7:50 ?? I tried the hyphen and the symbol but it did not work for me

  • @wahbi26.
    @wahbi26. 5 หลายเดือนก่อน

    thank you, the video is helpful

  • @-nu6co
    @-nu6co 7 หลายเดือนก่อน

    Well explained

  • @worldofelectronicsandprogr1128
    @worldofelectronicsandprogr1128 ปีที่แล้ว

    Can you make a video on creating automated welcome messages to new members in a Telegram group? It would be extremely useful! Thanks! ☺☺🙏🙏

  • @Zynnel
    @Zynnel ปีที่แล้ว

    Thank you so much this worked perfectly, i just have a question, how can I add emojis to the bot responses?

  • @emanuelalbuquerque9032
    @emanuelalbuquerque9032 ปีที่แล้ว

    Keep up this magnificent work that helps many people who work or want to work with technology. A hug directly from Brazil.

    • @anunareddy2733
      @anunareddy2733 ปีที่แล้ว

      Hello sir!

    • @bhai431
      @bhai431 9 หลายเดือนก่อน +1

      *What is PYTHON SCRYT? How to get that* ?

  • @xasaninomov1453
    @xasaninomov1453 ปีที่แล้ว +1

    help me a have some kind wierd situstion it says 'import 'telegram' not found'

  • @Aayein_97
    @Aayein_97 7 หลายเดือนก่อน

    hey nice video but can you please teach us how to make a AI chatbot for groups?

  • @zvim4664
    @zvim4664 ปีที่แล้ว +6

    Can somebody help me when i type % pip install python-telegram-bot in terminal i get this: You cannot call a method on a null-valued expression. Im stuck here for an hour cant find a solution help

    • @v3ng4r65
      @v3ng4r65 ปีที่แล้ว

      You have to get PATH in Windows for Phyton

  • @alteragnostik
    @alteragnostik 3 หลายเดือนก่อน +1

    Chat, could you tell me please what IDE is author using? Thanks

    • @tonisoos937
      @tonisoos937 2 หลายเดือนก่อน

      PyCharm

  • @parsahosseini4241
    @parsahosseini4241 6 หลายเดือนก่อน

    If you couldn't recieve any messages in your python side, in my case the problem was the `filters.Text` part, instead of passing it without calling it, I call it with no parameters like this: `filters.Text()`.

  • @ToddRoloff
    @ToddRoloff ปีที่แล้ว

    Nicely done.

  • @gulnarahuseynova1718
    @gulnarahuseynova1718 11 หลายเดือนก่อน

    Thank you so much!

  • @ilkhomjonabdurakhimov8158
    @ilkhomjonabdurakhimov8158 ปีที่แล้ว

    To create this telegram bot We should use Pycharm Ultimate or it is possible create it by Community version of program?

  • @G_Keepingitreal
    @G_Keepingitreal ปีที่แล้ว

    I was kind of curious to ask: if I create this bot - will i be able to access data of a website through it's API key? I want to perform an analysis of the data.

  • @Aamirmahdiy
    @Aamirmahdiy 24 วันที่ผ่านมา

    Where did you code? How did you import it in the bot

  • @domontowicz
    @domontowicz ปีที่แล้ว

    Hi! Thanks for the tutorial! Could you make a video about how to create a bot grabbing messages by keywords from different telegram private channels and sending to our private channel?

  • @bakousystems3888
    @bakousystems3888 ปีที่แล้ว

    thank you! very helpful. in grouptype show "supergroup" from console

  • @arsalanshafiq9260
    @arsalanshafiq9260 ปีที่แล้ว

    Great well done

  • @MichaelBomett
    @MichaelBomett ปีที่แล้ว

    Thanks for the video, how do i add the script to a django project so it runs alongside and uses context from django model to respond back? Any pointers?

  • @borismaiorov2703
    @borismaiorov2703 ปีที่แล้ว

    Hi! Thank you very much! Got it all done, no errors, but when i running the script i getting "Process finished with exit code 0"

  • @FLIX_TIME-z7g
    @FLIX_TIME-z7g ปีที่แล้ว +1

    i was wondering.
    after you wright your code.
    and you close studio code.
    will the bot still be active and running or will it crash.
    and if it crashes how can you get back to the script that you wrote.
    should you save the code itself and store it somewhere?

    • @cabbibal
      @cabbibal 10 หลายเดือนก่อน

      you will need a server that runs 24/7 and has the python program running

  • @zewelry
    @zewelry ปีที่แล้ว

    thank you. one question,i want run other thing when polling. how to do that.

  • @farshadpanahi4384
    @farshadpanahi4384 ปีที่แล้ว

    خیلی هم خوب. ادامه بده.

  • @CryptoSaNjAY1
    @CryptoSaNjAY1 11 หลายเดือนก่อน

    How to Create a bot without joining the source group it will forward messages to the designation group is it possible?

  • @mahdi-hasan
    @mahdi-hasan 11 หลายเดือนก่อน

    Can you please make tutorial on telethon or pyrogram?

  • @sikiciaddy8078
    @sikiciaddy8078 17 วันที่ผ่านมา

    how about a tutorial, about Bots sending messages in to groups ?

  • @YasminVessey
    @YasminVessey 9 หลายเดือนก่อน

    Would this still work using elif statements rather than if statements?

  • @telmuungan-ulzii8333
    @telmuungan-ulzii8333 ปีที่แล้ว

    What program are you using for coding?

  • @jacksonjiang6313
    @jacksonjiang6313 ปีที่แล้ว

    Thank you for your very clear explanation. But I am wondering how to purely send a message instead of replying? Coz I don't think it should be added into add_handler. Could you help me to solve that?

  • @LilaLili-j5i
    @LilaLili-j5i ปีที่แล้ว

    Did u paste the token on visual code studio or node.js

  • @Admin-oe8zj
    @Admin-oe8zj 5 หลายเดือนก่อน

    7.41 HOW YOU DO THE ARROW ...I AM Beginner SO I DON'T KNOW.

  • @HarutAdrenalin
    @HarutAdrenalin 4 หลายเดือนก่อน

    What interpreter do you use?

  • @systemkey1
    @systemkey1 8 หลายเดือนก่อน

    thank you SO much.!!

  • @Ayoubased
    @Ayoubased ปีที่แล้ว

    why we need to start with botfather, is this the native way of making bots in telegram?

  • @MrValVet
    @MrValVet 9 หลายเดือนก่อน

    Thank you!

  • @Myk-ix5xs
    @Myk-ix5xs ปีที่แล้ว +1

    I've tried install pip same way u did but it shows me error and I don't know why

    • @RileyNxt
      @RileyNxt ปีที่แล้ว

      pip3 instead

  • @nikhiljoshi-hk9zu
    @nikhiljoshi-hk9zu 10 หลายเดือนก่อน

    as the bot developer do you have access of the material I sent to the bot, or can the bot spread the material I have sent to it ....pls tell