Skip to content

Commit

Permalink
ea9a0d7f6811aaf9897c31ee756b1d98cf7fab48
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 4, 2024
1 parent 5b4fe83 commit ebf86f8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions esm/types/4_message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export interface _MessageBase {
/** The message's reply markup. */
replyMarkup?: ReplyMarkup;
businessConnectionId?: string;
senderBoostCount?: number;
viaBusinessBot?: User;
}
/**
* Properties shared between media message types.
Expand Down
10 changes: 10 additions & 0 deletions esm/types/4_message.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
forwards: message_.forwards,
isTopicMessage: false,
hasProtectedContent: message_.noforwards || false,
senderBoostCount: message_.from_boosts_applied,
};
if (message_.reactions) {
const recentReactions = message_.reactions.recent_reactions ?? [];
Expand Down Expand Up @@ -333,6 +334,15 @@ export async function constructMessage(message_, getEntity, getMessage, getStick
UNREACHABLE();
}
}
if (message_.via_business_bot_id != undefined) {
const viaBusinessBot = await getEntity(new types.PeerUser({ user_id: message_.via_business_bot_id }));
if (viaBusinessBot) {
message.viaBusinessBot = constructUser(viaBusinessBot);
}
else {
UNREACHABLE();
}
}
if (message_.post_author != undefined) {
message.authorSignature = message_.post_author;
}
Expand Down
2 changes: 2 additions & 0 deletions script/types/4_message.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export interface _MessageBase {
/** The message's reply markup. */
replyMarkup?: ReplyMarkup;
businessConnectionId?: string;
senderBoostCount?: number;
viaBusinessBot?: User;
}
/**
* Properties shared between media message types.
Expand Down
10 changes: 10 additions & 0 deletions script/types/4_message.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
forwards: message_.forwards,
isTopicMessage: false,
hasProtectedContent: message_.noforwards || false,
senderBoostCount: message_.from_boosts_applied,
};
if (message_.reactions) {
const recentReactions = message_.reactions.recent_reactions ?? [];
Expand Down Expand Up @@ -337,6 +338,15 @@ async function constructMessage(message_, getEntity, getMessage, getStickerSetNa
(0, _1_utilities_js_1.UNREACHABLE)();
}
}
if (message_.via_business_bot_id != undefined) {
const viaBusinessBot = await getEntity(new _2_tl_js_1.types.PeerUser({ user_id: message_.via_business_bot_id }));
if (viaBusinessBot) {
message.viaBusinessBot = (0, _1_user_js_1.constructUser)(viaBusinessBot);
}
else {
(0, _1_utilities_js_1.UNREACHABLE)();
}
}
if (message_.post_author != undefined) {
message.authorSignature = message_.post_author;
}
Expand Down

0 comments on commit ebf86f8

Please sign in to comment.