Attributes
Very Popular
Repository
Current version released
7 hours ago
Versions
- v1.32.0Latest
- v1.31.3
- v1.31.2
- v1.31.1
- v1.31.0
- v1.30.1
- v1.30.0
- v1.29.0
- v1.28.0
- v1.27.0
- v1.26.0
- v1.25.2
- v1.25.1
- v1.25.0
- v1.24.1
- v1.24.0
- v1.23.1
- v1.23.0
- v1.22.4
- v1.22.3
- v1.22.2
- v1.22.1
- v1.22.0
- v1.21.2
- v1.21.1
- v1.21.0
- v1.20.4
- v1.20.3
- v1.20.2
- v1.20.1
- v1.20.0
- v1.19.3
- v1.19.2
- v1.19.1
- v1.19.0
- v1.18.3
- v1.18.2
- v1.18.1
- v1.18.0
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.2
- v1.16.1
- v1.16.0
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.1
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.5
- v1.12.4
- v1.12.3
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.2
- v1.11.1
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
grammY
The grammY module lets you easily write Telegram bots. Here is a quickstart for you to get started, but note that a better explanation is in our repo on GitHub.
You may also want to check out the docs.
Quickstart
Talk to @BotFather to create a new Telegram bot and obtain a bot token.
Paste the following code into a new file bot.ts
.
import { Bot } from "https://deno.land/x/grammy/mod.ts";
// Create bot object
const bot = new Bot(""); // <-- place your bot token inside this string
// Listen for messages
bot.command("start", (ctx) => ctx.reply("Welcome! Send me a photo!"));
bot.on("message:text", (ctx) => ctx.reply("That is text and not a photo!"));
bot.on("message:photo", (ctx) => ctx.reply("Nice photo! Is that you?"));
bot.on(
"edited_message",
(ctx) =>
ctx.reply("Ha! Gotcha! You just edited this!", {
reply_parameters: { message_id: ctx.editedMessage.message_id },
}),
);
// Launch!
bot.start();
Congratulations! You have successfully created your first Telegram bot.
You can run it like so:
deno run --allow-net bot.ts