指南
进阶
介绍
内置插件
官方插件
第三方插件
示例
grammY
Telegram
概览
教程
简体中文
Appearance
Telegram Bot 框架。
…
grammY 使创建 Telegram Bot 变得如此简单!
grammY 是开放的,通过插件让它完全适合你的需要。
grammY 在你的 bot 拥有较多流量时提供可靠的帮助.
bot 是用 TypeScript(或JavaScript)编写的,并在各种平台上运行,包括 Node.js 。
npm install grammy 并粘贴以下代码:
npm install grammy
import { Bot } from "grammy"; const bot = new Bot(""); // <-- 把你的 bot token 放在 "" 之间 (https://t.me/BotFather) // 用"你好!"来回复任意信息 bot.on("message", (ctx) => ctx.reply("你好!")); bot.start();
const { Bot } = require("grammy"); const bot = new Bot(""); // <-- 把你的 bot token 放在 "" 之间 (https://t.me/BotFather) // 用"你好!"来回复任意信息 bot.on("message", (ctx) => ctx.reply("你好!")); bot.start();
import { Bot } from "https://deno.land/x/grammy@v1.19.0/mod.ts"; const bot = new Bot(""); // <-- 把你的 bot token 放在 "" 之间 (https://t.me/BotFather) // 用"你好!"来回复任意信息 bot.on("message", (ctx) => ctx.reply("你好!")); bot.start();
运行成功! 🎉