@wasserstoff/mangi-tg-bot
Version:
A powerful Telegram Bot SDK with built-in authentication, session management, and database integration
25 lines • 1.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unhandledFeature = void 0;
const grammy_1 = require("grammy");
const logger_1 = require("../helper/logger");
const handleMessageWithoutReply_1 = require("./handleMessageWithoutReply");
const handleMessageWithReply_1 = require("./handleMessageWithReply");
const composer = new grammy_1.Composer();
exports.unhandledFeature = composer;
const feature = composer.chatType("private");
feature.on("message", (0, logger_1.logHandle)("unhandled-message"), async (ctx) => {
ctx.api.sendChatAction(ctx.chat.id, "typing");
if (ctx.message.reply_to_message) {
await (0, handleMessageWithReply_1.handleMessageWithReply)(ctx);
}
else {
await (0, handleMessageWithoutReply_1.handleMessageWithoutReply)(ctx);
}
});
feature
.filter((ctx) => ctx.callbackQuery?.data === "say_hi")
.on("callback_query", async (ctx) => {
ctx.api.sendMessage(ctx.chat.id, `hi ${ctx.from?.first_name}`);
});
//# sourceMappingURL=unhandled.js.map