Skip to content

Commit

Permalink
added sticker info
Browse files Browse the repository at this point in the history
  • Loading branch information
gnehs committed Jun 23, 2024
1 parent 123cbc2 commit be7a2df
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions components/simple-reply.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { Composer } = require("telegraf");
const { message } = require("telegraf/filters");
const bot = new Composer();
const telegram = require("./telegram");

Expand Down Expand Up @@ -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(`<pre>${JSON.stringify(stickerInfo, null, 2)}</pre>`, {
reply_to_message_id: ctx.message.message_id,
parse_mode: "HTML",
});
});
module.exports = bot;

0 comments on commit be7a2df

Please sign in to comment.