Skip to main content
CF

Build Telegram Bots with JavaScript: The Complete Guide

5h 28m 48s
English
Paid

Unlock the power of Telegram with our comprehensive course on building bots using JavaScript and NodeJS. Perfect for those eager to delve into the world of bot creation, this guide equips you with the tools necessary to craft interactive and functional Telegram Bots.

Course Overview

Throughout this course, you will leverage the power of JavaScript and NodeJS to create versatile Telegram Bots using the intuitive Telegraf Framework. Initially, we will tackle the basics, enabling you to understand foundational bot functions and the essential components of the framework.

The Telegram Bots You'll Build

Embark on a journey to develop seven distinct bots, each tailored to hone your skills and deepen your understanding of the Telegraf framework and Telegram Bot API.

  • Echo Bot: Reflects user input, provides help messages, and logs interactions into another chat.
  • Media Bot: Facilitates file sharing, including photos, GIFs, and documents from various sources.
  • Simple API Bot: Utilizes external APIs to send engaging content like pictures of cats or dog breeds upon request.
  • Facts Bot: Extracts and displays data from Google Sheets without the need for the Google API.
  • Crypto Bot: Retrieves up-to-date cryptocurrency data and integrates custom keyboards for interactivity.
  • Channel Bot: Automates content sharing from Instagram, Facebook, or any RSS-supported website to your channel via RSS and Zapier.
  • Search Bot: Enables inline queries to search for images or Wikipedia entries within any chat context.

Advanced Deployment Techniques

Learn to deploy your Telegram Bot using Serverless Architecture with AWS Lambda and AWS API Gateway. This approach ensures scalability and minimizes server management needs, offering cost-effective and reliable hosting solutions.

Course Benefits

By the end of the course, your skillset will include logging functionalities, file handling, API utilization, Google Sheets integration, and more. Moreover, this course provides an excellent foundation for developing more complex bots.

Detailed Course Components

Delve deeper into the specifics of each bot's functionalities and use cases in the sections provided below.

Prerequisites

Before starting this course, ensure you have:

  • A valid Telegram account
  • Basic understanding of JavaScript

Target Audience

  • Beginners interested in creating Telegram bots
  • Individuals aiming to develop complex Telegram Bot functionalities
  • Enthusiasts keen on understanding the Telegram Bot API
  • Students looking to enhance their portfolios

Key Learning Outcomes

Discover the essential skills and knowledge you'll gain upon completing the course:

  • Master the Telegraf Framework and Telegram Bot API
  • Integrate advanced bot functions like custom keyboards and inline queries
  • Develop and deploy AWS Lambda Functions with appropriate Layers
  • Create API endpoints using AWS API Gateway
  • Implement Serverless Architecture for bot deployment on AWS
  • Retrieve and process information through External APIs
  • Utilize various toolkits such as Cryptocompare, Wiki, and Pixabay
  • Access and display data from Google Sheets using JSON
  • Adopt best coding practices for modular bot development
  • Leverage RSS and Zapier for automatic content posting
  • Explore polling and webhooks in bot applications

About the Author: Udemy

Udemy thumbnail

Udemy is the largest open marketplace for online courses on the internet. Founded in 2010 by Eren Bali, Oktay Caglar, and Gagan Biyani and headquartered in San Francisco, the company went public on the Nasdaq in 2021 under the ticker UDMY. The platform hosts well over two hundred thousand courses across software development, IT and cloud, data science, design, business, marketing, and creative skills, taught by tens of thousands of independent instructors. Roughly seventy million learners use it worldwide, and the corporate arm — Udemy Business — supplies a curated subset of that catalog to enterprise customers.

Because Udemy is a marketplace rather than a single editorial publisher, the catalog is uneven by design. The strongest material lives in the long-form, project-based courses authored by working engineers — full-stack JavaScript, React, Node.js, Python data science, AWS, Docker and Kubernetes, mobile development with Flutter and React Native, and cloud certification preparation. The CourseFlix listing under this source is the slice of that catalog that has been mirrored here for offline-friendly viewing, organized by topic and updated as new releases land. Pricing on Udemy itself swings dramatically with the site's near-permanent sales, which is why the platform is best treated as a deep reference catalog: pick instructors with strong reviews and a track record of updating their material rather than buying on the headline price alone.

Watch Online 129 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 129 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Introduction
All Course Lessons (129)
#Lesson TitleDurationAccess
1
Introduction Demo
02:38
2
Installing NodeJS and Visual Studio Code
01:56
3
Setting Up Workspace
01:11
4
Set Up Nodejs Project
03:05
5
Installing Packages
02:42
6
Create Bot and Bot's Token
02:33
7
About Telegram API
02:38
8
Basic Functions Introduction
01:55
9
Constructor
01:25
10
Important Commands
05:04
11
Telegraf Context
05:33
12
Bot Command Method
02:36
13
Bot Hears Method
02:58
14
Bot On Method
02:04
15
Other Methods
01:31
16
Bot Use Method
00:46
17
About Middleware
02:57
18
Next Function
01:00
19
State
02:24
20
Context Shortcuts
02:16
21
Extra Parameters
01:36
22
Echo Bot Introduction
00:58
23
Echo Bot Set-Up
01:51
24
Start and Help Commands
02:11
25
Echo Functionality
04:20
26
Logging Functionality
02:48
27
Logging Functionality 2
04:15
28
Log Information to Group Chat
03:00
29
Echo Bot Summary
02:21
30
Media Bot Introduction
00:39
31
Media Bot Set-Up
01:23
32
Working With Files
05:03
33
Send Methods
01:01
34
New York Command (Send Photo)
00:52
35
Reply To Message ID
02:11
36
Chat Action
02:24
37
Dubai Command (Send Gif/Animation)
01:26
38
Cities Command (Send Media Group)
04:24
39
List Command (Send Document)
03:01
40
Singapore Command (Send Location)
00:57
41
Get Download Link (Document)
05:09
42
Get Download Link (Photo)
01:44
43
Help Message
01:41
44
Simple API Bot Introduction
00:59
45
Simple API Bot Set-Up
01:51
46
Brief Introduction to HTTP
01:53
47
Fortune Cookie Command (Yerkee API)
03:37
48
Cat Command (Random Cat API)
05:34
49
Cat Command (Cat As A Service API)
02:23
50
Dog Breeds List Command
03:20
51
Dog Command (Exact Result)
04:58
52
Dog Command (Suggestions Filter)
03:35
53
Help Message
01:45
54
Markdown Style
02:27
55
Simple API Bot Summary
03:21
56
Facts Bot Introduction
00:50
57
Facts Bot Set-Up
01:30
58
Google Sheet Set-Up
02:15
59
Google Sheet JSON Link
02:57
60
Get Data Command
04:59
61
Fact Command
05:20
62
Update Command
02:11
63
Facts Bot Summary
01:58
64
Crypto Bot Introduction
01:14
65
Crypto Bot Set-Up
01:35
66
Inline Keyboard Markup
05:13
67
Handle Callback Query
02:31
68
Interactive Menu
05:00
69
Cryptocompare API Key
00:58
70
Start Message With Inline Keyboard
03:36
71
Price Message With Inline Keyboard
03:08
72
Back Button (Callback Query Handler)
01:50
73
Price Buttons (Callback Query Handlers)
10:34
74
Reply Keyboard Markup
04:02
75
Reply Keyboard Handlers
01:15
76
Remove Reply Keyboard
04:26
77
Channel Bot Introduction
00:58
78
Channel and Bot Set-Up
01:05
79
Understanding RSS
02:44
80
Get RSS from Instagram
01:05
81
Zapier - Create Trigger
01:30
82
Zapier - Create Action
01:27
83
Telegram Bot API
02:22
84
Zapier - Writing Fetch API
03:22
85
Get Channel Chat ID
04:20
86
Zapier - Setting InputData & Text Message
02:08
87
Remove Splash Text
01:39
88
Format Link (HTML Style)
01:52
89
Inline Keyboard Button
01:56
90
Switch On Zap!
00:42
91
Facebook - Create another Zap and RSS
03:46
92
Search Bot Introduction
01:40
93
Search Bot Set-Up and Enable Inline Mode
02:16
94
Inline Mode
03:49
95
Pixabay API
01:34
96
Handle Inline Query - Get data (Pixabay)
04:35
97
Handle Inline Query - Answer Query (Pixabay)
05:46
98
Caption & Markdown (Inline Keyboard)
03:18
99
Wikipedia API
02:19
100
Handle Inline Query - Get Data (Wiki)
03:21
101
Handle Inline Query - Answer Query (Wiki)
03:49
102
Switch Inline Query (Inline Keyboard)
01:52
103
Share Button
03:19
104
Enable Both Handlers
04:30
105
Switch Inline Query Current Chat (Inline Keyboard)
01:17
106
Start and Help Commands
04:22
107
Start and Help Inline Query
04:24
108
Set Placeholder with Botfather
01:01
109
Best Practices Introduction
00:25
110
Dotenv File Set-Up
02:10
111
Modular Folder Structure
05:14
112
Config File and Testing
02:49
113
Deployment Introduction
00:25
114
About AWS
01:33
115
Pricing (Lambda and API Gateway)
01:03
116
Polling Vs Webhooks
01:21
117
Polling Flow
01:09
118
Serverless Flow
01:27
119
Why Use Serverless?
01:31
120
Hosting Steps
00:58
121
Create Lambda Function
00:59
122
Create API Gateway Endpoint
02:39
123
Prepare Bot for Lambda - Code
03:40
124
Prepare Bot for Lambda - Layers (Node Modules)
02:57
125
Set Webhook (Bot Deployed)
02:13
126
Things to Take Note
01:31
127
Stop Webhook
00:39
128
Updating Bot
01:22
129
Delete Lambda and API Gateway
01:03
Unlock unlimited learning

Get instant access to all 128 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Related courses

Frequently asked questions

What are the prerequisites for enrolling in this course?
Before enrolling, you should have a basic understanding of JavaScript, as the course uses it extensively to create Telegram Bots. Familiarity with NodeJS will also be beneficial since it is a core part of the development process. The initial lessons cover installation and setup of NodeJS and Visual Studio Code, so having these installed can help you start quickly.
What kinds of bots will I be building in this course?
The course guides you through building seven different Telegram Bots. These include an Echo Bot for reflecting user input, a Media Bot for sharing files, a Simple API Bot that uses external APIs, a Facts Bot for extracting data from Google Sheets, a Crypto Bot for cryptocurrency data, a Channel Bot for content automation via RSS, and a Search Bot for inline queries. Each bot focuses on different functionalities to expand your skills with the Telegraf framework.
Who would benefit most from taking this course?
This course is ideal for developers and tech enthusiasts interested in creating interactive Telegram Bots. It's perfect for those looking to enhance their skills in JavaScript and NodeJS while exploring practical applications of the Telegraf framework and Telegram Bot API. Whether you're a beginner with some coding experience or an intermediate developer, the course offers valuable insights into bot development.
How does the depth of this course compare to others on the same topic?
This course provides a detailed walkthrough of using the Telegraf framework and covers a wide range of functionalities, from basic bot commands to advanced API integrations. With 129 lessons, the course offers a comprehensive exploration of bot development compared to shorter courses that might only cover basic bot functionalities.
What specific tools or platforms will I use in this course?
The course primarily utilizes JavaScript and NodeJS, with the Telegraf framework as the main tool for building Telegram Bots. You'll also use Visual Studio Code as the development environment. For specific functionalities, you'll work with various APIs, Google Sheets for data extraction, and platforms like Instagram and Facebook through RSS feeds for the Channel Bot.
What topics are not covered in this course?
While the course covers a broad range of functionalities for building Telegram Bots, it does not delve into advanced topics like machine learning integrations or detailed backend server management. Additionally, it does not cover the use of the Google API, focusing instead on Google Sheets data extraction without it.
What is the expected time commitment to complete this course?
The course consists of 129 lessons, and while the exact runtime isn't specified, you should be prepared to dedicate a significant amount of time to go through all the lessons and practical exercises. The course is designed to be thorough, allowing you to build and understand different types of Telegram Bots, so plan accordingly to fully absorb the material.