grammY 爱莫吉语Name
添加 emoji 解析 格莱姆Y。 。 。 . 看看这个 正式文件 以了解更多关于此插件的信息.
安装
使用 npm :
npm install @grammyjs/emoji
使用 Yarn :
yarn add @grammyjs/emoji
使用 Deno 时 :
import {/* ... */} from "https://deno.land/x/grammy_emoji/mod.ts";
使用量
import { Bot, Context } from "grammy";
import { EmojiFlavor, emojiParser } from "@grammyjs/emoji";
type MyContext = EmojiFlavor<Context>;
const bot = new Bot<MyContext>(""); // <-- put your bot token between the ""
bot.use(emojiParser());
bot.command("ping", async (ctx) => {
// Don't know emoji names? No problem!
// Press Ctrl + Space on supported editors to
// see IntelliSense auto-completion magic.
await ctx.reply(ctx.emoji`Pong! ${"ping_pong"}`);
// > Pong! 🏓
});
bot.command("start", async (ctx) => {
await ctx
.replyWithEmoji`Welcome to my bot! ${"grinning_face_with_big_eyes"}`;
// > Welcome to my bot! 😀
});
bot.start();
贡献
捐款是十分受欢迎的! 只要确定是否有类似的公关, 这样你就可以从那里捐款.