Skip to content

Commit

Permalink
95fe04cfd3080813b6730b9f8043a3abec42b801
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 4, 2024
1 parent ebf86f8 commit b9231e9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion esm/client/2_message_manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FileManager } from "./1_file_manager.js";
interface C extends C_ {
fileManager: FileManager;
}
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateBotDeleteBusinessMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
export declare class MessageManager {
#private;
constructor(c: C);
Expand Down
6 changes: 6 additions & 0 deletions esm/client/2_message_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ export class MessageManager {
update instanceof types.UpdateEditChannelMessage ||
update instanceof types.UpdateBotNewBusinessMessage ||
update instanceof types.UpdateBotEditBusinessMessage ||
update instanceof types.UpdateBotDeleteBusinessMessage ||
update instanceof types.UpdateDeleteMessages ||
update instanceof types.UpdateDeleteChannelMessages ||
update instanceof types.UpdateChannelParticipant ||
Expand Down Expand Up @@ -692,6 +693,11 @@ export class MessageManager {
}
return { deletedMessages };
}
else if (update instanceof types.UpdateBotDeleteBusinessMessage) {
const chatId = peerToChatId(update.peer);
const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
return { deletedMessages, businessConnectionId: update.connection_id };
}
if (update instanceof types.UpdateChannelParticipant || update instanceof types.UpdateChatParticipant) {
const chatMember = await constructChatMemberUpdated(update, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
const selfId = await __classPrivateFieldGet(this, _MessageManager_c, "f").getSelfId();
Expand Down
1 change: 1 addition & 0 deletions esm/types/6_update.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface UpdateEditedMessage {
export interface UpdateDeletedMessages {
/** The deleted messages. */
deletedMessages: MessageReference[];
businessConnectionId?: string;
}
/**
* A callback query was made (a user presses an inline button). Bot-only.
Expand Down
2 changes: 1 addition & 1 deletion script/client/2_message_manager.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { FileManager } from "./1_file_manager.js";
interface C extends C_ {
fileManager: FileManager;
}
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
type MessageManagerUpdate = types.UpdateNewMessage | types.UpdateNewChannelMessage | types.UpdateEditMessage | types.UpdateEditChannelMessage | types.UpdateBotNewBusinessMessage | types.UpdateBotEditBusinessMessage | types.UpdateBotDeleteBusinessMessage | types.UpdateDeleteMessages | types.UpdateDeleteChannelMessages | types.UpdateChannelParticipant | types.UpdateChatParticipant;
export declare class MessageManager {
#private;
constructor(c: C);
Expand Down
6 changes: 6 additions & 0 deletions script/client/2_message_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ class MessageManager {
update instanceof _2_tl_js_1.types.UpdateEditChannelMessage ||
update instanceof _2_tl_js_1.types.UpdateBotNewBusinessMessage ||
update instanceof _2_tl_js_1.types.UpdateBotEditBusinessMessage ||
update instanceof _2_tl_js_1.types.UpdateBotDeleteBusinessMessage ||
update instanceof _2_tl_js_1.types.UpdateDeleteMessages ||
update instanceof _2_tl_js_1.types.UpdateDeleteChannelMessages ||
update instanceof _2_tl_js_1.types.UpdateChannelParticipant ||
Expand Down Expand Up @@ -695,6 +696,11 @@ class MessageManager {
}
return { deletedMessages };
}
else if (update instanceof _2_tl_js_1.types.UpdateBotDeleteBusinessMessage) {
const chatId = (0, _2_tl_js_1.peerToChatId)(update.peer);
const deletedMessages = update.messages.map((v) => ({ chatId, messageId: v }));
return { deletedMessages, businessConnectionId: update.connection_id };
}
if (update instanceof _2_tl_js_1.types.UpdateChannelParticipant || update instanceof _2_tl_js_1.types.UpdateChatParticipant) {
const chatMember = await (0, _3_types_js_1.constructChatMemberUpdated)(update, __classPrivateFieldGet(this, _MessageManager_c, "f").getEntity);
const selfId = await __classPrivateFieldGet(this, _MessageManager_c, "f").getSelfId();
Expand Down
1 change: 1 addition & 0 deletions script/types/6_update.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface UpdateEditedMessage {
export interface UpdateDeletedMessages {
/** The deleted messages. */
deletedMessages: MessageReference[];
businessConnectionId?: string;
}
/**
* A callback query was made (a user presses an inline button). Bot-only.
Expand Down

0 comments on commit b9231e9

Please sign in to comment.