Comparing version 4.16.0 to 4.16.1
@@ -1184,7 +1184,9 @@ "use strict"; | ||
function getUserFromAnySource(ctx) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
if (ctx.callbackQuery) | ||
return ctx.callbackQuery.from; | ||
const msg = ctx.msg; | ||
if (msg === null || msg === void 0 ? void 0 : msg.has('from')) | ||
return msg.from; | ||
return ((_j = (_h = ((_g = (_f = (_e = (_d = (_c = (_b = (_a = ctx.callbackQuery) !== null && _a !== void 0 ? _a : ctx.inlineQuery) !== null && _b !== void 0 ? _b : ctx.shippingQuery) !== null && _c !== void 0 ? _c : ctx.preCheckoutQuery) !== null && _d !== void 0 ? _d : ctx.chosenInlineResult) !== null && _e !== void 0 ? _e : ctx.chatMember) !== null && _f !== void 0 ? _f : ctx.myChatMember) !== null && _g !== void 0 ? _g : ctx.chatJoinRequest)) === null || _h === void 0 ? void 0 : _h.from) !== null && _j !== void 0 ? _j : (_o = ((_l = (_k = ctx.messageReaction) !== null && _k !== void 0 ? _k : ctx.pollAnswer) !== null && _l !== void 0 ? _l : (_m = ctx.chatBoost) === null || _m === void 0 ? void 0 : _m.boost.source)) === null || _o === void 0 ? void 0 : _o.user); | ||
return ((_h = (_g = ((_f = (_e = (_d = (_c = (_b = (_a = ctx.inlineQuery) !== null && _a !== void 0 ? _a : ctx.shippingQuery) !== null && _b !== void 0 ? _b : ctx.preCheckoutQuery) !== null && _c !== void 0 ? _c : ctx.chosenInlineResult) !== null && _d !== void 0 ? _d : ctx.chatMember) !== null && _e !== void 0 ? _e : ctx.myChatMember) !== null && _f !== void 0 ? _f : ctx.chatJoinRequest)) === null || _g === void 0 ? void 0 : _g.from) !== null && _h !== void 0 ? _h : (_m = ((_k = (_j = ctx.messageReaction) !== null && _j !== void 0 ? _j : ctx.pollAnswer) !== null && _k !== void 0 ? _k : (_l = ctx.chatBoost) === null || _l === void 0 ? void 0 : _l.boost.source)) === null || _m === void 0 ? void 0 : _m.user); | ||
} | ||
@@ -1191,0 +1193,0 @@ function getMsgIdFromAnySource(ctx) { |
{ | ||
"name": "telegraf", | ||
"version": "4.16.0", | ||
"version": "4.16.1", | ||
"description": "Modern Telegram Bot Framework", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -1596,2 +1596,4 @@ import * as tg from './core/types/typegram' | ||
function getUserFromAnySource<U extends tg.Update>(ctx: Context<U>) { | ||
if (ctx.callbackQuery) return ctx.callbackQuery.from | ||
const msg = ctx.msg | ||
@@ -1602,3 +1604,2 @@ if (msg?.has('from')) return msg.from | ||
( | ||
ctx.callbackQuery ?? | ||
ctx.inlineQuery ?? | ||
@@ -1605,0 +1606,0 @@ ctx.shippingQuery ?? |
Sorry, the diff of this file is not supported yet
688715
14805