Creating a telegram bot using Node JS

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2023
  • In this comprehensive tutorial, we'll delve into the following key aspects:
    1. Creating a Telegram Bot: Discover the step-by-step process of setting up your very own Telegram bot from scratch.
    2. Setting Up a Node.js Application: Learn how to configure a Node.js application to effectively listen to and interact with your Telegram bot.
    3. Connecting Local Development with Telegram: We'll guide you through the process of connecting your local development environment to Telegram using the powerful tool, ngrok.
    4. Creating Custom Telegram Commands: Unlock the potential of your bot by mastering the creation of custom Telegram commands tailored to your specific needs.
    5. Responding to Commands: Understand how to craft dynamic responses for your Telegram bot, allowing it to interact seamlessly with users.
    Join us on this exciting journey of Telegram bot development and enhance your skills in building interactive and responsive bots for various applications!
    Problem statement:
    Think about all those photos we take with friends and family. Sometimes, when we stumble upon an old picture, it's like traveling back in time to those wonderful moments. So, here's what we're doing in this tutorial series: we're creating a Telegram bot. This bot can find a random photo from our Google Photos collection. Let's build it together!
    Videos in these series
    #0 Problem statement (Why we are building this): • Creating a Telegram Bo...
    #1 Creating a telegram bot using Node JS - Current video
    #2 Google Photos API Integration: From Setup to Code Implementation - • Google Photos API Inte...
    #3 Building a Node.js App with PostgreSQL: Setup, Schema, and CRUD - • Building a Node.js App...
    #4 Streamlining the Application with Telegram Commands | Advanced Tutorial - • Streamlining the Appli...
    #5 Node.js & PostgreSQL Deployment Tutorial: Free Hosting to Cloud using Render - • Node.js & PostgreSQL D...
    Useful links
    API to update webhook: core.telegram.org/bots/api#se...
    Ngrok : ngrok.com/
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @2ch921
    @2ch921 3 หลายเดือนก่อน +4

    Amazing tutorial, you not only shows us commands and lines of code, you actually teach and I find it amazing

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

    Underrated tutorial!

  • @arnavghosh4242
    @arnavghosh4242 6 วันที่ผ่านมา

    This tutorial is really useful, since you can just modify the code and host it on vercel or render

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

    In my case its always error in ngrok
    bad gateway 502 and got error
    node:internal/process/promises:289
    AxiosError [AggregateError]
    Can you help me

  • @othekaka
    @othekaka 15 วันที่ผ่านมา

    OMG, that's a best tutorial that I've seen. You've explain everything about the process, thanks for your video. Just one thing, If I use "node-telegram-bot-api" will be not necessary use the ngork, right?

    • @lets-build-together
      @lets-build-together  14 วันที่ผ่านมา

      Hey thank you! I didn’t use that api, but, if you are using webhook, you need it, since telegram only supports https.
      github.com/yagop/node-telegram-bot-api/blob/master/doc/usage.md#webhooks

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

    please can have one for nextjs

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

    Hey bro, what happens when we not using webhook ?

    • @lets-build-together
      @lets-build-together  6 หลายเดือนก่อน

      Then you can use polling, where you can check telegram every x seconds(say 5 seconds) , then every 5 seconds you can check with telegram servers that any new message is there

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

    *Wich app is this: **1:20** please make Detail Video not able to understand in this sir. Pleasssereeeeerrrr*

    • @lets-build-together
      @lets-build-together  8 หลายเดือนก่อน

      Hey hi, yes i will try to make as detailed as possible, next time. The app I am using is VsCode, but you can use any code editor

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

    How do i deploy this on prod with ngrok

    • @lets-build-together
      @lets-build-together  14 วันที่ผ่านมา

      You don’t need to ngrok to deploy to prod. If you follow later videos we deployed to production

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

    "Sir, will this ngrok make my Telegram bot appear 24/7?"

    • @okonkwo.ify18
      @okonkwo.ify18 3 หลายเดือนก่อน

      Explain more so I help you

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

      ​​@@okonkwo.ify18
      Deploy the server publicly so it can be accessed(using ngrok)
      Can you please help me on this

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

    Please can we get he source code? At least for the setup part

    • @lets-build-together
      @lets-build-together  7 หลายเดือนก่อน

      Hey hi, all the code I showed in the video. If you still need the source code, please email me, I will share it with you.

    • @user-bc1xp2of2x
      @user-bc1xp2of2x 5 หลายเดือนก่อน

      where we can mail you, say the id or direct guthub link

    • @user-bc1xp2of2x
      @user-bc1xp2of2x 5 หลายเดือนก่อน

      where we can mail you, say the id or direct guthub link

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

    Keep doing this great work bro!
    Also need a javascript course in your language.
    Your explanation is top notch😊

    • @lets-build-together
      @lets-build-together  6 หลายเดือนก่อน +1

      Thank you, will consider making a course in future

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

    Hi,
    It was all working perfectly fine before, but now I am getting the 405 'not allowed' results with ngrok. Not sure how to get it working again.
    Steps I am taking
    - running `ngrok http 4040` in terminal
    - copying the url to postman and adding it the api call, resulting in 'webhook was set' in postman
    - terminal gives back: POST/ 405 method not allowed
    Tried this steps multiple times. What could be wrong?
    Great tutorial btw, thanks

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

    This tutorial is unnecessarily complex

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

      I do not mean to sound rude; do you have a better one, as I’m a beginner and would like to develop a telegram bot

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

      @@CryLight- I'm also learning to develop but his code is bit complex, logic and functionality is simple and good but the syntax is the complex

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

    hey hi , i got an error says that messageObj.text is undefined

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

      Did you get any solution regarding this, i am getting the same error.

    • @nikkifacts07
      @nikkifacts07 6 หลายเดือนก่อน +1

      use if condition if you got messageObj then it go ahead
      @@lordesca4364

    • @lets-build-together
      @lets-build-together  5 หลายเดือนก่อน

      Hey hi, as @nikkifacts07 said, have a if condition check. Also check if you server is reacting to any other requests apart of telegram

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

      @@lets-build-together it is better with long polling instead of webhooks

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

      how did you solve it?