diff --git a/components/simple-reply.js b/components/simple-reply.js index 8acfdd7..a3c8f6c 100644 --- a/components/simple-reply.js +++ b/components/simple-reply.js @@ -1,4 +1,5 @@ const { Composer } = require("telegraf"); +const { message } = require("telegraf/filters"); const bot = new Composer(); const telegram = require("./telegram"); @@ -107,4 +108,26 @@ bot.command("getuserinfo", async (ctx) => { reply_to_message_id: ctx.message.message_id, }); }); + +// sticker info +bot.on(message("sticker"), (ctx) => { + // is private + if (ctx.chat.type != "private") { + return; + } + let sticker = ctx.message.sticker; + let stickerInfo = { + file_id: sticker.file_id, + file_unique_id: sticker.file_unique_id, + width: sticker.width, + height: sticker.height, + is_animated: sticker.is_animated, + emoji: sticker.emoji, + set_name: sticker.set_name, + }; + ctx.reply(`
${JSON.stringify(stickerInfo, null, 2)}`, { + reply_to_message_id: ctx.message.message_id, + parse_mode: "HTML", + }); +}); module.exports = bot;