@grammyjs/emoji
Advanced tools
Comparing version 1.0.0 to 1.1.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -1,4 +0,4 @@ | ||
import { Context, Message, Middleware } from "./deps.node.js"; | ||
import { Context, NextFunction } from "./deps.node.js"; | ||
import type { EmojiName } from "./emoji.js"; | ||
export interface EmojiFlavor { | ||
export declare type EmojiFlavor<C extends Context = Context> = C & { | ||
/** | ||
@@ -27,5 +27,5 @@ * You can use this method to parse a string with emojis. | ||
*/ | ||
replyWithEmoji: (string: TemplateStringsArray, ...emojis: EmojiName[]) => Promise<Message.TextMessage>; | ||
} | ||
export declare function emojiParser<C extends Context & EmojiFlavor>(): Middleware<C>; | ||
replyWithEmoji: (string: TemplateStringsArray, ...emojis: EmojiName[]) => ReturnType<C['reply']>; | ||
}; | ||
export declare function emojiParser<C extends EmojiFlavor>(): (ctx: C, next: NextFunction) => Promise<void>; | ||
export declare function emoji(name: EmojiName): string; |
@@ -14,5 +14,3 @@ "use strict"; | ||
ctx.emoji = withEmoji; | ||
ctx.replyWithEmoji = (text, ...emojis) => { | ||
return ctx.reply(withEmoji(text, ...emojis)); | ||
}; | ||
ctx.replyWithEmoji = (text, ...emojis) => ctx.reply(withEmoji(text, ...emojis)); | ||
await next(); | ||
@@ -19,0 +17,0 @@ }; |
{ | ||
"name": "@grammyjs/emoji", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Use emoji names instead of Unicode strings. Copy-pasting emoji sucks.", | ||
@@ -23,4 +23,4 @@ "homepage": "https://grammy.dev/plugins/emoji", | ||
"name": "André Silveira", | ||
"email": "andremarcia4@gmail.com", | ||
"url": "https://github.com/AndreoliBR" | ||
"email": "pro.andresilveira@gmail.com", | ||
"url": "https://github.com/andrrms" | ||
}, | ||
@@ -36,6 +36,8 @@ "contributors": [ | ||
"peerDependencies": { | ||
"grammy": "^1.5.1" | ||
"grammy": "^1.7.1" | ||
}, | ||
"devDependencies": { | ||
"deno2node": "~1.0.0" | ||
"@grammyjs/types": "^2.6.0", | ||
"deno2node": "^1.3.0", | ||
"grammy": "^1.7.1" | ||
}, | ||
@@ -42,0 +44,0 @@ "keywords": [ |
@@ -31,3 +31,3 @@ # grammY Emoji | ||
type MyContext = Context & EmojiFlavor; | ||
type MyContext = EmojiFlavor<Context>; | ||
const bot = new Bot<MyContext>(""); // <-- put your bot token between the "" | ||
@@ -34,0 +34,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
802955
3
11
15941
1