@grammyjs/emoji
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

grammY emoji

Adds emoji parsing for grammY. Check out the official documentation to learn more about this plugin.

Installation

Using npm:

npm install @grammyjs/emoji

Using Yarn:

yarn add @grammyjs/emoji

Using Deno:

import {/* ... */} from "https://deno.land/x/grammy_emoji/mod.ts";

Usage

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();

Contribute

Contributions are more than welcome! Just make sure if there is already a similar PR, so you can contribute from there.

Package Sidebar

Install

npm i @grammyjs/emoji

Weekly Downloads

141

Version

1.2.0

License

MIT

Unpacked Size

847 kB

Total Files

11

Last publish

Collaborators

  • knorpelsenf
  • andrrms