@mtkruto/node 0.191.0 → 0.193.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/esm/3_types.d.ts +8 -3
- package/esm/3_types.d.ts.map +1 -1
- package/esm/3_types.js +8 -3
- package/esm/client/0_html.d.ts +2 -1
- package/esm/client/0_html.d.ts.map +1 -1
- package/esm/client/0_html.js +18 -16
- package/esm/client/0_markdown.d.ts +3 -2
- package/esm/client/0_markdown.d.ts.map +1 -1
- package/esm/client/0_markdown.js +6 -4
- package/esm/client/0_params.d.ts +54 -0
- package/esm/client/0_params.d.ts.map +1 -1
- package/esm/client/1_client_generic.d.ts +154 -14
- package/esm/client/1_client_generic.d.ts.map +1 -1
- package/esm/client/3_account_manager.d.ts +5 -1
- package/esm/client/3_account_manager.d.ts.map +1 -1
- package/esm/client/3_account_manager.js +40 -2
- package/esm/client/3_message_manager.js +1 -1
- package/esm/client/3_secret_chat_manager.d.ts +10 -4
- package/esm/client/3_secret_chat_manager.d.ts.map +1 -1
- package/esm/client/3_secret_chat_manager.js +82 -76
- package/esm/client/3_sticker_set_manager.d.ts +5 -0
- package/esm/client/3_sticker_set_manager.d.ts.map +1 -1
- package/esm/client/3_sticker_set_manager.js +40 -9
- package/esm/client/4_chat_manager.d.ts +5 -1
- package/esm/client/4_chat_manager.d.ts.map +1 -1
- package/esm/client/4_chat_manager.js +59 -1
- package/esm/client/4_checklist_manager.js +1 -1
- package/esm/client/4_context.d.ts +16 -4
- package/esm/client/4_context.d.ts.map +1 -1
- package/esm/client/4_context.js +38 -5
- package/esm/client/4_forum_manager.d.ts +5 -1
- package/esm/client/4_forum_manager.d.ts.map +1 -1
- package/esm/client/4_forum_manager.js +38 -1
- package/esm/client/6_client.d.ts +152 -12
- package/esm/client/6_client.d.ts.map +1 -1
- package/esm/client/6_client.js +191 -11
- package/esm/client/6_client_dispatcher.d.ts +152 -12
- package/esm/client/6_client_dispatcher.d.ts.map +1 -1
- package/esm/client/6_client_dispatcher.js +191 -11
- package/esm/types/0_report_reason.d.ts +1 -0
- package/esm/types/0_report_reason.d.ts.map +1 -1
- package/esm/types/0_story_report_option.d.ts +3 -0
- package/esm/types/0_story_report_option.d.ts.map +1 -1
- package/esm/types/1_available_reactions.d.ts +3 -2
- package/esm/types/1_available_reactions.d.ts.map +1 -1
- package/esm/types/1_available_reactions.js +18 -1
- package/esm/types/1_channel_location.d.ts +8 -0
- package/esm/types/1_channel_location.d.ts.map +1 -0
- package/esm/types/1_channel_location.js +11 -0
- package/esm/types/1_sticker_set_p.d.ts +48 -0
- package/esm/types/1_sticker_set_p.d.ts.map +1 -0
- package/esm/types/1_sticker_set_p.js +73 -0
- package/esm/types/1_story_report_result.d.ts +17 -3
- package/esm/types/1_story_report_result.d.ts.map +1 -1
- package/esm/types/2_poll_voter.d.ts +19 -0
- package/esm/types/2_poll_voter.d.ts.map +1 -1
- package/esm/types/2_poll_voter.js +19 -0
- package/esm/types/2_secret_message.d.ts +1 -0
- package/esm/types/2_secret_message.d.ts.map +1 -1
- package/esm/types/3_bot_access_settings.d.ts +3 -0
- package/esm/types/3_bot_access_settings.d.ts.map +1 -1
- package/esm/types/3_connected_website.d.ts +10 -0
- package/esm/types/3_connected_website.d.ts.map +1 -1
- package/esm/types/3_poll_voter_list.d.ts +1 -0
- package/esm/types/3_poll_voter_list.d.ts.map +1 -1
- package/esm/types/3_rich_text_component.d.ts +24 -0
- package/esm/types/3_rich_text_component.d.ts.map +1 -1
- package/esm/types/3_text_to_translate.d.ts +3 -0
- package/esm/types/3_text_to_translate.d.ts.map +1 -1
- package/esm/types/3_translated_text.d.ts +3 -0
- package/esm/types/3_translated_text.d.ts.map +1 -1
- package/esm/types/4_page_block.d.ts +45 -1
- package/esm/types/4_page_block.d.ts.map +1 -1
- package/esm/types/A_topic.d.ts +20 -3
- package/esm/types/A_topic.d.ts.map +1 -1
- package/esm/types/A_topic.js +37 -0
- package/esm/types/B_recent_action.d.ts +225 -0
- package/esm/types/B_recent_action.d.ts.map +1 -0
- package/esm/types/B_recent_action.js +303 -0
- package/esm/types/{1_secret_chat_action.js → B_topic_list_item.d.ts} +9 -8
- package/esm/types/B_topic_list_item.d.ts.map +1 -0
- package/esm/types/B_topic_list_item.js +20 -0
- package/esm/types/B_update.d.ts +16 -16
- package/esm/types/B_update.d.ts.map +1 -1
- package/esm/types/C_recent_actions_entry.d.ts +13 -0
- package/esm/types/C_recent_actions_entry.d.ts.map +1 -0
- package/esm/types/C_recent_actions_entry.js +13 -0
- package/esm/types/C_topic_list.d.ts +34 -0
- package/esm/types/C_topic_list.d.ts.map +1 -0
- package/esm/types/{1_secret_chat_action.d.ts → C_topic_list.js} +8 -10
- package/package.json +1 -1
- package/script/3_types.d.ts +8 -3
- package/script/3_types.d.ts.map +1 -1
- package/script/3_types.js +8 -3
- package/script/client/0_html.d.ts +2 -1
- package/script/client/0_html.d.ts.map +1 -1
- package/script/client/0_html.js +17 -15
- package/script/client/0_markdown.d.ts +3 -2
- package/script/client/0_markdown.d.ts.map +1 -1
- package/script/client/0_markdown.js +5 -3
- package/script/client/0_params.d.ts +54 -0
- package/script/client/0_params.d.ts.map +1 -1
- package/script/client/1_client_generic.d.ts +154 -14
- package/script/client/1_client_generic.d.ts.map +1 -1
- package/script/client/3_account_manager.d.ts +5 -1
- package/script/client/3_account_manager.d.ts.map +1 -1
- package/script/client/3_account_manager.js +40 -2
- package/script/client/3_message_manager.js +1 -1
- package/script/client/3_secret_chat_manager.d.ts +10 -4
- package/script/client/3_secret_chat_manager.d.ts.map +1 -1
- package/script/client/3_secret_chat_manager.js +81 -75
- package/script/client/3_sticker_set_manager.d.ts +5 -0
- package/script/client/3_sticker_set_manager.d.ts.map +1 -1
- package/script/client/3_sticker_set_manager.js +39 -8
- package/script/client/4_chat_manager.d.ts +5 -1
- package/script/client/4_chat_manager.d.ts.map +1 -1
- package/script/client/4_chat_manager.js +58 -0
- package/script/client/4_checklist_manager.js +1 -1
- package/script/client/4_context.d.ts +16 -4
- package/script/client/4_context.d.ts.map +1 -1
- package/script/client/4_context.js +38 -5
- package/script/client/4_forum_manager.d.ts +5 -1
- package/script/client/4_forum_manager.d.ts.map +1 -1
- package/script/client/4_forum_manager.js +37 -0
- package/script/client/6_client.d.ts +152 -12
- package/script/client/6_client.d.ts.map +1 -1
- package/script/client/6_client.js +191 -11
- package/script/client/6_client_dispatcher.d.ts +152 -12
- package/script/client/6_client_dispatcher.d.ts.map +1 -1
- package/script/client/6_client_dispatcher.js +191 -11
- package/script/types/0_report_reason.d.ts +1 -0
- package/script/types/0_report_reason.d.ts.map +1 -1
- package/script/types/0_story_report_option.d.ts +3 -0
- package/script/types/0_story_report_option.d.ts.map +1 -1
- package/script/types/1_available_reactions.d.ts +3 -2
- package/script/types/1_available_reactions.d.ts.map +1 -1
- package/script/types/1_available_reactions.js +18 -0
- package/script/types/1_channel_location.d.ts +8 -0
- package/script/types/1_channel_location.d.ts.map +1 -0
- package/script/types/1_channel_location.js +14 -0
- package/script/types/1_sticker_set_p.d.ts +48 -0
- package/script/types/1_sticker_set_p.d.ts.map +1 -0
- package/script/types/1_sticker_set_p.js +76 -0
- package/script/types/1_story_report_result.d.ts +17 -3
- package/script/types/1_story_report_result.d.ts.map +1 -1
- package/script/types/2_poll_voter.d.ts +19 -0
- package/script/types/2_poll_voter.d.ts.map +1 -1
- package/script/types/2_poll_voter.js +19 -0
- package/script/types/2_secret_message.d.ts +1 -0
- package/script/types/2_secret_message.d.ts.map +1 -1
- package/script/types/3_bot_access_settings.d.ts +3 -0
- package/script/types/3_bot_access_settings.d.ts.map +1 -1
- package/script/types/3_connected_website.d.ts +10 -0
- package/script/types/3_connected_website.d.ts.map +1 -1
- package/script/types/3_poll_voter_list.d.ts +1 -0
- package/script/types/3_poll_voter_list.d.ts.map +1 -1
- package/script/types/3_rich_text_component.d.ts +24 -0
- package/script/types/3_rich_text_component.d.ts.map +1 -1
- package/script/types/3_text_to_translate.d.ts +3 -0
- package/script/types/3_text_to_translate.d.ts.map +1 -1
- package/script/types/3_translated_text.d.ts +3 -0
- package/script/types/3_translated_text.d.ts.map +1 -1
- package/script/types/4_page_block.d.ts +45 -1
- package/script/types/4_page_block.d.ts.map +1 -1
- package/script/types/A_topic.d.ts +20 -3
- package/script/types/A_topic.d.ts.map +1 -1
- package/script/types/A_topic.js +38 -0
- package/script/types/B_recent_action.d.ts +225 -0
- package/script/types/B_recent_action.d.ts.map +1 -0
- package/script/types/B_recent_action.js +306 -0
- package/script/types/{1_secret_chat_action.d.ts → B_topic_list_item.d.ts} +9 -10
- package/script/types/B_topic_list_item.d.ts.map +1 -0
- package/script/types/{1_secret_chat_action.js → B_topic_list_item.js} +0 -10
- package/script/types/B_update.d.ts +16 -16
- package/script/types/B_update.d.ts.map +1 -1
- package/script/types/C_recent_actions_entry.d.ts +13 -0
- package/script/types/C_recent_actions_entry.d.ts.map +1 -0
- package/script/types/C_recent_actions_entry.js +16 -0
- package/script/types/C_topic_list.d.ts +34 -0
- package/script/types/C_topic_list.d.ts.map +1 -0
- package/script/types/C_topic_list.js +31 -0
- package/esm/types/1_secret_chat_action.d.ts.map +0 -1
- package/script/types/1_secret_chat_action.d.ts.map +0 -1
package/esm/types/A_topic.d.ts
CHANGED
|
@@ -17,10 +17,15 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import
|
|
20
|
+
import { Api } from "../2_tl.js";
|
|
21
|
+
import type { ChatP, PeerGetter } from "./1_chat_p.js";
|
|
21
22
|
import type { Message } from "./9_message.js";
|
|
22
|
-
/**
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* An active forum topic.
|
|
25
|
+
* @unlisted
|
|
26
|
+
*/
|
|
27
|
+
export interface TopicActive {
|
|
28
|
+
type: "active";
|
|
24
29
|
/** The ID of the topic. */
|
|
25
30
|
id: number;
|
|
26
31
|
/** The point in time when the topic was created. */
|
|
@@ -40,5 +45,17 @@ export interface Topic {
|
|
|
40
45
|
/** The icon of the topic. */
|
|
41
46
|
customEmojiId?: string;
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* An active forum topic.
|
|
50
|
+
* @unlisted
|
|
51
|
+
*/
|
|
52
|
+
export interface TopicDeleted {
|
|
53
|
+
type: "deleted";
|
|
54
|
+
/** The ID of the topic. */
|
|
55
|
+
id: number;
|
|
56
|
+
}
|
|
57
|
+
/** Any type of forum topic. */
|
|
58
|
+
export type Topic = TopicActive | TopicDeleted;
|
|
43
59
|
export declare function constructTopic(message: Message): Topic;
|
|
60
|
+
export declare function constructTopic2(ft: Api.ForumTopic, getPeer: PeerGetter): Topic;
|
|
44
61
|
//# sourceMappingURL=A_topic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_topic.d.ts","sourceRoot":"","sources":["../../src/types/A_topic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"A_topic.d.ts","sourceRoot":"","sources":["../../src/types/A_topic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAqD,MAAM,gBAAgB,CAAC;AAEjG;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,OAAO,EAAE,KAAK,CAAC;IACf,yCAAyC;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,mCAAmC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,2BAA2B;IAC3B,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,+BAA+B;AAC/B,MAAM,MAAM,KAAK,GAAG,WAAW,GAAG,YAAY,CAAC;AAE/C,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAuCtD;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,KAAK,CAkC9E"}
|
package/esm/types/A_topic.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { unreachable } from "../0_deps.js";
|
|
21
21
|
import { cleanObject } from "../1_utilities.js";
|
|
22
|
+
import { Api } from "../2_tl.js";
|
|
22
23
|
export function constructTopic(message) {
|
|
23
24
|
let forumTopicCreated;
|
|
24
25
|
let forumTopicEdited;
|
|
@@ -48,6 +49,7 @@ export function constructTopic(message) {
|
|
|
48
49
|
customEmojiId = forumTopicEdited.forumTopicEdited.customEmojiId;
|
|
49
50
|
}
|
|
50
51
|
return cleanObject({
|
|
52
|
+
type: "active",
|
|
51
53
|
id,
|
|
52
54
|
date,
|
|
53
55
|
creator: creator,
|
|
@@ -57,5 +59,40 @@ export function constructTopic(message) {
|
|
|
57
59
|
name,
|
|
58
60
|
color,
|
|
59
61
|
customEmojiId,
|
|
62
|
+
isDeleted: false,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export function constructTopic2(ft, getPeer) {
|
|
66
|
+
if (Api.is("forumTopicDeleted", ft)) {
|
|
67
|
+
return {
|
|
68
|
+
type: "deleted",
|
|
69
|
+
id: ft.id,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const peer = getPeer(ft.from_id);
|
|
73
|
+
if (peer === null) {
|
|
74
|
+
unreachable();
|
|
75
|
+
}
|
|
76
|
+
const id = ft.id;
|
|
77
|
+
const date = ft.date;
|
|
78
|
+
const creator = peer[0];
|
|
79
|
+
const isGeneral = id === 1;
|
|
80
|
+
const isClosed = !!ft.closed;
|
|
81
|
+
const isHidden = !!ft.hidden;
|
|
82
|
+
const name = ft.title;
|
|
83
|
+
const color = ft.icon_color;
|
|
84
|
+
const customEmojiId = ft.icon_emoji_id ? String(ft.icon_emoji_id) : undefined;
|
|
85
|
+
return cleanObject({
|
|
86
|
+
type: "active",
|
|
87
|
+
id,
|
|
88
|
+
date,
|
|
89
|
+
creator,
|
|
90
|
+
isGeneral,
|
|
91
|
+
isClosed,
|
|
92
|
+
isHidden,
|
|
93
|
+
name,
|
|
94
|
+
color,
|
|
95
|
+
customEmojiId,
|
|
96
|
+
isDeleted: false,
|
|
60
97
|
});
|
|
61
98
|
}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { Api } from "../2_tl.js";
|
|
2
|
+
import { type ChatMemberRights } from "./0_chat_member_rights.js";
|
|
3
|
+
import { type AvailableReactions } from "./1_available_reactions.js";
|
|
4
|
+
import { type ChannelLocation } from "./1_channel_location.js";
|
|
5
|
+
import type { PeerGetter } from "./1_chat_p.js";
|
|
6
|
+
import { type Photo } from "./1_photo.js";
|
|
7
|
+
import type { StickerSetNameGetter } from "./1_sticker.js";
|
|
8
|
+
import { type ChatMember } from "./2_chat_member.js";
|
|
9
|
+
import { type InviteLink } from "./3_invite_link.js";
|
|
10
|
+
import { type Message, type MessageGetter } from "./9_message.js";
|
|
11
|
+
import { type Topic } from "./A_topic.js";
|
|
12
|
+
export interface RecentActionChangeTitle {
|
|
13
|
+
type: "changeTitle";
|
|
14
|
+
previous: string;
|
|
15
|
+
new: string;
|
|
16
|
+
}
|
|
17
|
+
export interface RecentActionChangeDescription {
|
|
18
|
+
type: "changeDescription";
|
|
19
|
+
previous: string;
|
|
20
|
+
new: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RecentActionChangeUsername {
|
|
23
|
+
type: "changeUsername";
|
|
24
|
+
previous: string;
|
|
25
|
+
new: string;
|
|
26
|
+
}
|
|
27
|
+
export interface RecentActionChangePhoto {
|
|
28
|
+
type: "changePhoto";
|
|
29
|
+
previous: Photo;
|
|
30
|
+
new: Photo;
|
|
31
|
+
}
|
|
32
|
+
export interface RecentActionToggleInvites {
|
|
33
|
+
type: "toggleInvites";
|
|
34
|
+
isEnabled: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface RecentActionToggleSignatures {
|
|
37
|
+
type: "toggleSignatures";
|
|
38
|
+
isEnabled: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface RecentActionPinMessage {
|
|
41
|
+
type: "pinMessage";
|
|
42
|
+
message: Message;
|
|
43
|
+
}
|
|
44
|
+
export interface RecentActionEditMessage {
|
|
45
|
+
type: "editMessage";
|
|
46
|
+
previous: Message;
|
|
47
|
+
new: Message;
|
|
48
|
+
}
|
|
49
|
+
export interface RecentActionDeleteMessage {
|
|
50
|
+
type: "deleteMessage";
|
|
51
|
+
message: Message;
|
|
52
|
+
}
|
|
53
|
+
export interface RecentActionJoin {
|
|
54
|
+
type: "join";
|
|
55
|
+
}
|
|
56
|
+
export interface RecentActionLeave {
|
|
57
|
+
type: "leave";
|
|
58
|
+
}
|
|
59
|
+
export interface RecentActionInvite {
|
|
60
|
+
type: "invite";
|
|
61
|
+
chatMember: ChatMember;
|
|
62
|
+
}
|
|
63
|
+
export interface RecentActionToggleRestriction {
|
|
64
|
+
type: "toggleRestriction";
|
|
65
|
+
previous: ChatMember;
|
|
66
|
+
new: ChatMember;
|
|
67
|
+
}
|
|
68
|
+
export interface RecentActionTogglePromotion {
|
|
69
|
+
type: "togglePromotion";
|
|
70
|
+
previous: ChatMember;
|
|
71
|
+
new: ChatMember;
|
|
72
|
+
}
|
|
73
|
+
export interface RecentActionChangeStickerSet {
|
|
74
|
+
type: "changeStickerSet";
|
|
75
|
+
previous?: string;
|
|
76
|
+
new?: string;
|
|
77
|
+
}
|
|
78
|
+
export interface RecentActionToggleChatHistoryForNewMembers {
|
|
79
|
+
type: "toggleChatHistoryForNewMembers";
|
|
80
|
+
isEnabled: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface RecentActionSetDefaultPermissions {
|
|
83
|
+
type: "setDefaultPermissions";
|
|
84
|
+
previous: ChatMemberRights;
|
|
85
|
+
new: ChatMemberRights;
|
|
86
|
+
}
|
|
87
|
+
export interface RecentActionStopPoll {
|
|
88
|
+
type: "stopPoll";
|
|
89
|
+
message: Message;
|
|
90
|
+
}
|
|
91
|
+
export interface RecentActionChangeDiscussionChat {
|
|
92
|
+
type: "changeDiscussionChat";
|
|
93
|
+
previous: number;
|
|
94
|
+
new: number;
|
|
95
|
+
}
|
|
96
|
+
export interface RecentActionChangeLocation {
|
|
97
|
+
type: "changeLocation";
|
|
98
|
+
previous?: ChannelLocation;
|
|
99
|
+
new?: ChannelLocation;
|
|
100
|
+
}
|
|
101
|
+
export interface RecentActionChangeSetSlowMode {
|
|
102
|
+
type: "setSlowMode";
|
|
103
|
+
previous: number;
|
|
104
|
+
new: number;
|
|
105
|
+
}
|
|
106
|
+
export interface RecentActionStartVideoChat {
|
|
107
|
+
type: "startVideoChat";
|
|
108
|
+
}
|
|
109
|
+
export interface RecentActionEndVideoChat {
|
|
110
|
+
type: "endVideoChat";
|
|
111
|
+
}
|
|
112
|
+
export interface RecentActionMuteVideoChatParticipant {
|
|
113
|
+
type: "muteVideoChatParticipant";
|
|
114
|
+
participant: number;
|
|
115
|
+
}
|
|
116
|
+
export interface RecentActionUnmuteVideoChatParticipant {
|
|
117
|
+
type: "unmuteVideoChatParticipant";
|
|
118
|
+
participant: number;
|
|
119
|
+
}
|
|
120
|
+
export interface RecentActionToggleVideoChatDefaultMuted {
|
|
121
|
+
type: "toggleVideoChatDefaultMuted";
|
|
122
|
+
defaultMuted: boolean;
|
|
123
|
+
}
|
|
124
|
+
export interface RecentActionJoinByInvite {
|
|
125
|
+
type: "joinByInvite";
|
|
126
|
+
inviteLink?: InviteLink;
|
|
127
|
+
isViaList: boolean;
|
|
128
|
+
}
|
|
129
|
+
export interface RecentActionDeleteInviteLink {
|
|
130
|
+
type: "deleteInviteLink";
|
|
131
|
+
inviteLink?: InviteLink;
|
|
132
|
+
}
|
|
133
|
+
export interface RecentActionRevokeInviteLink {
|
|
134
|
+
type: "revokeInviteLink";
|
|
135
|
+
inviteLink?: InviteLink;
|
|
136
|
+
}
|
|
137
|
+
export interface RecentActionEditInviteLink {
|
|
138
|
+
type: "editInviteLink";
|
|
139
|
+
previous?: InviteLink;
|
|
140
|
+
new?: InviteLink;
|
|
141
|
+
}
|
|
142
|
+
export interface RecentActionSetVideoChatParticipantVolume {
|
|
143
|
+
type: "setVideoChatParticipantVolume";
|
|
144
|
+
participant: number;
|
|
145
|
+
}
|
|
146
|
+
export interface RecentActionSetHistoryTtl {
|
|
147
|
+
type: "setHistoryTtl";
|
|
148
|
+
previous: number;
|
|
149
|
+
new: number;
|
|
150
|
+
}
|
|
151
|
+
export interface RecentActionJoinByRequest {
|
|
152
|
+
type: "joinByRequest";
|
|
153
|
+
inviteLink?: InviteLink;
|
|
154
|
+
approvedBy: number;
|
|
155
|
+
}
|
|
156
|
+
export interface RecentActionToggleContentProtection {
|
|
157
|
+
type: "toggleContentProtection";
|
|
158
|
+
isEnabled: boolean;
|
|
159
|
+
}
|
|
160
|
+
export interface RecentActionSendMessage {
|
|
161
|
+
type: "sendMessage";
|
|
162
|
+
message: Message;
|
|
163
|
+
}
|
|
164
|
+
export interface RecentActionSetAvailableReactions {
|
|
165
|
+
type: "setAvailableReactions";
|
|
166
|
+
previous: AvailableReactions;
|
|
167
|
+
new: AvailableReactions;
|
|
168
|
+
}
|
|
169
|
+
export interface RecentActionSetUsernames {
|
|
170
|
+
type: "setUsernames";
|
|
171
|
+
previous: string[];
|
|
172
|
+
new: string[];
|
|
173
|
+
}
|
|
174
|
+
export interface RecentActionToggleTopics {
|
|
175
|
+
type: "toggleTopics";
|
|
176
|
+
isEnabled: boolean;
|
|
177
|
+
}
|
|
178
|
+
export interface RecentActionCreateTopic {
|
|
179
|
+
type: "createTopic";
|
|
180
|
+
topic: Topic;
|
|
181
|
+
}
|
|
182
|
+
export interface RecentActionEditTopic {
|
|
183
|
+
type: "editTopic";
|
|
184
|
+
previous: Topic;
|
|
185
|
+
new: Topic;
|
|
186
|
+
}
|
|
187
|
+
export interface RecentActionDeleteTopic {
|
|
188
|
+
type: "deleteTopic";
|
|
189
|
+
topic: Topic;
|
|
190
|
+
}
|
|
191
|
+
export interface RecentActionPinTopic {
|
|
192
|
+
type: "pinTopic";
|
|
193
|
+
previous?: Topic;
|
|
194
|
+
new?: Topic;
|
|
195
|
+
}
|
|
196
|
+
export interface RecentActionToggleAntispam {
|
|
197
|
+
type: "toggleAntispam";
|
|
198
|
+
isEnabled: boolean;
|
|
199
|
+
}
|
|
200
|
+
export interface RecentActionSetEmojiStickerSet {
|
|
201
|
+
type: "setEmojiStickerSet";
|
|
202
|
+
previous?: string;
|
|
203
|
+
new?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface RecentActionParticipantSubExtend {
|
|
206
|
+
type: "participantSubExtend";
|
|
207
|
+
previousParticipant: string;
|
|
208
|
+
newParticipant: string;
|
|
209
|
+
}
|
|
210
|
+
export interface RecentActionToggleAutomaticTranslation {
|
|
211
|
+
type: "toggleAutomaticTranslation";
|
|
212
|
+
isEnabled: boolean;
|
|
213
|
+
}
|
|
214
|
+
export interface RecentActionEditChatMemberTag {
|
|
215
|
+
type: "editChatMemberTag";
|
|
216
|
+
userId: number;
|
|
217
|
+
previous?: string;
|
|
218
|
+
new?: string;
|
|
219
|
+
}
|
|
220
|
+
export interface RecentActionUnsupported {
|
|
221
|
+
type: "unsupported";
|
|
222
|
+
}
|
|
223
|
+
export type RecentAction = RecentActionChangeTitle | RecentActionChangeDescription | RecentActionChangeUsername | RecentActionChangePhoto | RecentActionToggleInvites | RecentActionToggleSignatures | RecentActionPinMessage | RecentActionEditMessage | RecentActionDeleteMessage | RecentActionJoin | RecentActionLeave | RecentActionInvite | RecentActionToggleRestriction | RecentActionTogglePromotion | RecentActionChangeStickerSet | RecentActionToggleChatHistoryForNewMembers | RecentActionSetDefaultPermissions | RecentActionStopPoll | RecentActionChangeDiscussionChat | RecentActionChangeLocation | RecentActionChangeSetSlowMode | RecentActionStartVideoChat | RecentActionEndVideoChat | RecentActionMuteVideoChatParticipant | RecentActionUnmuteVideoChatParticipant | RecentActionToggleVideoChatDefaultMuted | RecentActionJoinByInvite | RecentActionDeleteInviteLink | RecentActionRevokeInviteLink | RecentActionEditInviteLink | RecentActionSetVideoChatParticipantVolume | RecentActionSetHistoryTtl | RecentActionJoinByRequest | RecentActionToggleContentProtection | RecentActionSendMessage | RecentActionSetAvailableReactions | RecentActionSetUsernames | RecentActionToggleTopics | RecentActionCreateTopic | RecentActionEditTopic | RecentActionDeleteTopic | RecentActionPinTopic | RecentActionToggleAntispam | RecentActionSetEmojiStickerSet | RecentActionToggleAutomaticTranslation | RecentActionEditChatMemberTag | RecentActionUnsupported;
|
|
224
|
+
export declare function constructRecentAction(a: Api.ChannelAdminLogEventAction, getPeer: PeerGetter, getMessage: MessageGetter, getStickerSetName: StickerSetNameGetter): Promise<RecentAction>;
|
|
225
|
+
//# sourceMappingURL=B_recent_action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"B_recent_action.d.ts","sourceRoot":"","sources":["../../src/types/B_recent_action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,KAAK,gBAAgB,EAA6B,MAAM,2BAA2B,CAAC;AAC7F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A4B,GAC5B,0BAA0B,GAC1B,yCAAyC,GACzC,yBAAyB,GACzB,yBAAyB,GACzB,mCAAmC,GACnC,uBAAuB,GACvB,iCAAiC,GACjC,wBAAwB,GACxB,wBAAwB,GACxB,uBAAuB,GACvB,qBAAqB,GACrB,uBAAuB,GACvB,oBAAoB,GACpB,0BAA0B,GAC1B,8BAA8B,GAC9B,sCAAsC,GACtC,6BAA6B,GAC7B,uBAAuB,CAAC;AAiB5B,wBAAsB,qBAAqB,CAAC,CAAC,EAAE,GAAG,CAAC,0BAA0B,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC,CAqR7L"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { unreachable } from "../0_deps.js";
|
|
2
|
+
import { cleanObject } from "../1_utilities.js";
|
|
3
|
+
import { Api } from "../2_tl.js";
|
|
4
|
+
import { peerToChatId } from "../tl/2_telegram.js";
|
|
5
|
+
import { constructChatMemberRights } from "./0_chat_member_rights.js";
|
|
6
|
+
import { constructAvailableReactions } from "./1_available_reactions.js";
|
|
7
|
+
import { constructChannelLocation } from "./1_channel_location.js";
|
|
8
|
+
import { constructPhoto } from "./1_photo.js";
|
|
9
|
+
import { constructChatMember } from "./2_chat_member.js";
|
|
10
|
+
import { constructInviteLink } from "./3_invite_link.js";
|
|
11
|
+
import { constructMessage } from "./9_message.js";
|
|
12
|
+
import { constructTopic2 } from "./A_topic.js";
|
|
13
|
+
function getChannelParticipantPeer(participant) {
|
|
14
|
+
switch (participant._) {
|
|
15
|
+
case "channelParticipant":
|
|
16
|
+
case "channelParticipantSelf":
|
|
17
|
+
case "channelParticipantCreator":
|
|
18
|
+
case "channelParticipantAdmin":
|
|
19
|
+
return { _: "peerUser", user_id: participant.user_id };
|
|
20
|
+
case "channelParticipantBanned":
|
|
21
|
+
case "channelParticipantLeft":
|
|
22
|
+
return participant.peer;
|
|
23
|
+
default:
|
|
24
|
+
unreachable();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export async function constructRecentAction(a, getPeer, getMessage, getStickerSetName) {
|
|
28
|
+
switch (a._) {
|
|
29
|
+
case "channelAdminLogEventActionChangeTitle":
|
|
30
|
+
return {
|
|
31
|
+
type: "changeTitle",
|
|
32
|
+
previous: a.prev_value,
|
|
33
|
+
new: a.new_value,
|
|
34
|
+
};
|
|
35
|
+
case "channelAdminLogEventActionChangeAbout":
|
|
36
|
+
return {
|
|
37
|
+
type: "changeDescription",
|
|
38
|
+
previous: a.prev_value,
|
|
39
|
+
new: a.new_value,
|
|
40
|
+
};
|
|
41
|
+
case "channelAdminLogEventActionChangeUsername":
|
|
42
|
+
return {
|
|
43
|
+
type: "changeUsername",
|
|
44
|
+
previous: a.prev_value,
|
|
45
|
+
new: a.prev_value,
|
|
46
|
+
};
|
|
47
|
+
case "channelAdminLogEventActionChangePhoto":
|
|
48
|
+
return {
|
|
49
|
+
type: "changePhoto",
|
|
50
|
+
previous: constructPhoto(Api.as("photo", a.prev_photo)),
|
|
51
|
+
new: constructPhoto(Api.as("photo", a.new_photo)),
|
|
52
|
+
};
|
|
53
|
+
case "channelAdminLogEventActionToggleInvites":
|
|
54
|
+
return {
|
|
55
|
+
type: "toggleInvites",
|
|
56
|
+
isEnabled: a.new_value,
|
|
57
|
+
};
|
|
58
|
+
case "channelAdminLogEventActionToggleSignatures":
|
|
59
|
+
return {
|
|
60
|
+
type: "toggleSignatures",
|
|
61
|
+
isEnabled: a.new_value,
|
|
62
|
+
};
|
|
63
|
+
case "channelAdminLogEventActionUpdatePinned":
|
|
64
|
+
return {
|
|
65
|
+
type: "pinMessage",
|
|
66
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
67
|
+
};
|
|
68
|
+
case "channelAdminLogEventActionEditMessage":
|
|
69
|
+
return {
|
|
70
|
+
type: "editMessage",
|
|
71
|
+
previous: await constructMessage(a.prev_message, getPeer, getMessage, getStickerSetName, false),
|
|
72
|
+
new: await constructMessage(a.new_message, getPeer, getMessage, getStickerSetName, false),
|
|
73
|
+
};
|
|
74
|
+
case "channelAdminLogEventActionDeleteMessage":
|
|
75
|
+
return {
|
|
76
|
+
type: "deleteMessage",
|
|
77
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
78
|
+
};
|
|
79
|
+
case "channelAdminLogEventActionParticipantJoin":
|
|
80
|
+
return {
|
|
81
|
+
type: "join",
|
|
82
|
+
};
|
|
83
|
+
case "channelAdminLogEventActionParticipantLeave":
|
|
84
|
+
return {
|
|
85
|
+
type: "leave",
|
|
86
|
+
};
|
|
87
|
+
case "channelAdminLogEventActionParticipantInvite": {
|
|
88
|
+
const peer = getPeer(getChannelParticipantPeer(a.participant));
|
|
89
|
+
if (peer === null) {
|
|
90
|
+
unreachable();
|
|
91
|
+
}
|
|
92
|
+
return {
|
|
93
|
+
type: "invite",
|
|
94
|
+
chatMember: constructChatMember(peer[0], a.participant, getPeer),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
case "channelAdminLogEventActionParticipantToggleBan": {
|
|
98
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
99
|
+
if (peer === null) {
|
|
100
|
+
unreachable();
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
type: "toggleRestriction",
|
|
104
|
+
previous: constructChatMember(peer[0], a.prev_participant, getPeer),
|
|
105
|
+
new: constructChatMember(peer[0], a.new_participant, getPeer),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
case "channelAdminLogEventActionParticipantToggleAdmin": {
|
|
109
|
+
const peer = getPeer(getChannelParticipantPeer(a.new_participant));
|
|
110
|
+
if (peer === null) {
|
|
111
|
+
unreachable();
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
type: "togglePromotion",
|
|
115
|
+
previous: constructChatMember(peer[0], a.prev_participant, getPeer),
|
|
116
|
+
new: constructChatMember(peer[0], a.new_participant, getPeer),
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
case "channelAdminLogEventActionChangeStickerSet":
|
|
120
|
+
return cleanObject({
|
|
121
|
+
type: "changeStickerSet",
|
|
122
|
+
previous: Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
123
|
+
new: Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
124
|
+
});
|
|
125
|
+
case "channelAdminLogEventActionTogglePreHistoryHidden":
|
|
126
|
+
return {
|
|
127
|
+
type: "toggleChatHistoryForNewMembers",
|
|
128
|
+
isEnabled: a.new_value,
|
|
129
|
+
};
|
|
130
|
+
case "channelAdminLogEventActionDefaultBannedRights":
|
|
131
|
+
return {
|
|
132
|
+
type: "setDefaultPermissions",
|
|
133
|
+
previous: constructChatMemberRights(a.prev_banned_rights),
|
|
134
|
+
new: constructChatMemberRights(a.new_banned_rights),
|
|
135
|
+
};
|
|
136
|
+
case "channelAdminLogEventActionStopPoll":
|
|
137
|
+
return {
|
|
138
|
+
type: "stopPoll",
|
|
139
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
140
|
+
};
|
|
141
|
+
case "channelAdminLogEventActionChangeLinkedChat":
|
|
142
|
+
return {
|
|
143
|
+
type: "changeDiscussionChat",
|
|
144
|
+
previous: peerToChatId({ _: "peerChannel", channel_id: a.prev_value }),
|
|
145
|
+
new: peerToChatId({ _: "peerChannel", channel_id: a.new_value }),
|
|
146
|
+
};
|
|
147
|
+
case "channelAdminLogEventActionChangeLocation":
|
|
148
|
+
return cleanObject({
|
|
149
|
+
type: "changeLocation",
|
|
150
|
+
previous: Api.is("channelLocation", a.prev_value) ? constructChannelLocation(a.prev_value) : undefined,
|
|
151
|
+
new: Api.is("channelLocation", a.new_value) ? constructChannelLocation(a.new_value) : undefined,
|
|
152
|
+
});
|
|
153
|
+
case "channelAdminLogEventActionToggleSlowMode":
|
|
154
|
+
return {
|
|
155
|
+
type: "setSlowMode",
|
|
156
|
+
previous: a.prev_value,
|
|
157
|
+
new: a.new_value,
|
|
158
|
+
};
|
|
159
|
+
case "channelAdminLogEventActionStartGroupCall":
|
|
160
|
+
return {
|
|
161
|
+
type: "startVideoChat",
|
|
162
|
+
};
|
|
163
|
+
case "channelAdminLogEventActionDiscardGroupCall":
|
|
164
|
+
return {
|
|
165
|
+
type: "endVideoChat",
|
|
166
|
+
};
|
|
167
|
+
case "channelAdminLogEventActionParticipantMute":
|
|
168
|
+
return {
|
|
169
|
+
type: "muteVideoChatParticipant",
|
|
170
|
+
participant: peerToChatId(a.participant.peer),
|
|
171
|
+
};
|
|
172
|
+
case "channelAdminLogEventActionParticipantUnmute":
|
|
173
|
+
return {
|
|
174
|
+
type: "unmuteVideoChatParticipant",
|
|
175
|
+
participant: peerToChatId(a.participant.peer),
|
|
176
|
+
};
|
|
177
|
+
case "channelAdminLogEventActionToggleGroupCallSetting":
|
|
178
|
+
return {
|
|
179
|
+
type: "toggleVideoChatDefaultMuted",
|
|
180
|
+
defaultMuted: a.join_muted,
|
|
181
|
+
};
|
|
182
|
+
case "channelAdminLogEventActionParticipantJoinByInvite":
|
|
183
|
+
return cleanObject({
|
|
184
|
+
type: "joinByInvite",
|
|
185
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
186
|
+
isViaList: !!a.via_chatlist,
|
|
187
|
+
});
|
|
188
|
+
case "channelAdminLogEventActionExportedInviteDelete":
|
|
189
|
+
return cleanObject({
|
|
190
|
+
type: "deleteInviteLink",
|
|
191
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
192
|
+
});
|
|
193
|
+
case "channelAdminLogEventActionExportedInviteRevoke":
|
|
194
|
+
return cleanObject({
|
|
195
|
+
type: "revokeInviteLink",
|
|
196
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
197
|
+
});
|
|
198
|
+
case "channelAdminLogEventActionExportedInviteEdit":
|
|
199
|
+
return cleanObject({
|
|
200
|
+
type: "editInviteLink",
|
|
201
|
+
previous: Api.is("chatInviteExported", a.prev_invite) ? constructInviteLink(a.prev_invite, getPeer) : undefined,
|
|
202
|
+
new: Api.is("chatInviteExported", a.new_invite) ? constructInviteLink(a.new_invite, getPeer) : undefined,
|
|
203
|
+
});
|
|
204
|
+
case "channelAdminLogEventActionParticipantVolume":
|
|
205
|
+
return {
|
|
206
|
+
type: "setVideoChatParticipantVolume",
|
|
207
|
+
participant: peerToChatId(a.participant.peer),
|
|
208
|
+
};
|
|
209
|
+
case "channelAdminLogEventActionChangeHistoryTTL":
|
|
210
|
+
return {
|
|
211
|
+
type: "setHistoryTtl",
|
|
212
|
+
previous: a.prev_value,
|
|
213
|
+
new: a.new_value,
|
|
214
|
+
};
|
|
215
|
+
case "channelAdminLogEventActionParticipantJoinByRequest":
|
|
216
|
+
return cleanObject({
|
|
217
|
+
type: "joinByRequest",
|
|
218
|
+
inviteLink: Api.is("chatInviteExported", a.invite) ? constructInviteLink(a.invite, getPeer) : undefined,
|
|
219
|
+
approvedBy: Number(a.approved_by),
|
|
220
|
+
});
|
|
221
|
+
case "channelAdminLogEventActionToggleNoForwards":
|
|
222
|
+
return {
|
|
223
|
+
type: "toggleContentProtection",
|
|
224
|
+
isEnabled: a.new_value,
|
|
225
|
+
};
|
|
226
|
+
case "channelAdminLogEventActionSendMessage":
|
|
227
|
+
return {
|
|
228
|
+
type: "sendMessage",
|
|
229
|
+
message: await constructMessage(a.message, getPeer, getMessage, getStickerSetName, false),
|
|
230
|
+
};
|
|
231
|
+
case "channelAdminLogEventActionChangeAvailableReactions":
|
|
232
|
+
return {
|
|
233
|
+
type: "setAvailableReactions",
|
|
234
|
+
previous: constructAvailableReactions(a.prev_value),
|
|
235
|
+
new: constructAvailableReactions(a.new_value),
|
|
236
|
+
};
|
|
237
|
+
case "channelAdminLogEventActionChangeUsernames":
|
|
238
|
+
return {
|
|
239
|
+
type: "setUsernames",
|
|
240
|
+
previous: a.prev_value,
|
|
241
|
+
new: a.new_value,
|
|
242
|
+
};
|
|
243
|
+
case "channelAdminLogEventActionToggleForum":
|
|
244
|
+
return {
|
|
245
|
+
type: "toggleAntispam",
|
|
246
|
+
isEnabled: a.new_value,
|
|
247
|
+
};
|
|
248
|
+
case "channelAdminLogEventActionCreateTopic":
|
|
249
|
+
return {
|
|
250
|
+
type: "createTopic",
|
|
251
|
+
topic: constructTopic2(a.topic, getPeer),
|
|
252
|
+
};
|
|
253
|
+
case "channelAdminLogEventActionEditTopic":
|
|
254
|
+
return {
|
|
255
|
+
type: "editTopic",
|
|
256
|
+
previous: constructTopic2(a.prev_topic, getPeer),
|
|
257
|
+
new: constructTopic2(a.new_topic, getPeer),
|
|
258
|
+
};
|
|
259
|
+
case "channelAdminLogEventActionDeleteTopic":
|
|
260
|
+
return {
|
|
261
|
+
type: "deleteTopic",
|
|
262
|
+
topic: constructTopic2(a.topic, getPeer),
|
|
263
|
+
};
|
|
264
|
+
case "channelAdminLogEventActionPinTopic":
|
|
265
|
+
return cleanObject({
|
|
266
|
+
type: "pinTopic",
|
|
267
|
+
previous: a.prev_topic ? constructTopic2(a.prev_topic, getPeer) : undefined,
|
|
268
|
+
new: a.new_topic ? constructTopic2(a.new_topic, getPeer) : undefined,
|
|
269
|
+
});
|
|
270
|
+
case "channelAdminLogEventActionToggleAntiSpam":
|
|
271
|
+
return {
|
|
272
|
+
type: "toggleAntispam",
|
|
273
|
+
isEnabled: a.new_value,
|
|
274
|
+
};
|
|
275
|
+
case "channelAdminLogEventActionChangeEmojiStickerSet":
|
|
276
|
+
return cleanObject({
|
|
277
|
+
type: "setEmojiStickerSet",
|
|
278
|
+
previous: Api.is("inputStickerSetShortName", a.prev_stickerset) ? a.prev_stickerset.short_name : undefined,
|
|
279
|
+
new: Api.is("inputStickerSetShortName", a.new_stickerset) ? a.new_stickerset.short_name : undefined,
|
|
280
|
+
});
|
|
281
|
+
case "channelAdminLogEventActionToggleSignatureProfiles":
|
|
282
|
+
return {
|
|
283
|
+
type: "toggleSignatures",
|
|
284
|
+
isEnabled: a.new_value,
|
|
285
|
+
};
|
|
286
|
+
case "channelAdminLogEventActionToggleAutotranslation":
|
|
287
|
+
return {
|
|
288
|
+
type: "toggleAutomaticTranslation",
|
|
289
|
+
isEnabled: a.new_value,
|
|
290
|
+
};
|
|
291
|
+
case "channelAdminLogEventActionParticipantEditRank":
|
|
292
|
+
return cleanObject({
|
|
293
|
+
type: "editChatMemberTag",
|
|
294
|
+
userId: Number(a.user_id),
|
|
295
|
+
previous: a.prev_rank || undefined,
|
|
296
|
+
newTag: a.new_rank || undefined,
|
|
297
|
+
});
|
|
298
|
+
default:
|
|
299
|
+
return {
|
|
300
|
+
type: "unsupported",
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
}
|
|
@@ -17,12 +17,13 @@
|
|
|
17
17
|
* You should have received a copy of the GNU Lesser General Public License
|
|
18
18
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
import type { Message } from "./9_message.js";
|
|
21
|
+
import type { Topic } from "./A_topic.js";
|
|
22
|
+
/** An item of a topic list. */
|
|
23
|
+
export interface TopicListItem {
|
|
24
|
+
/** The topic. */
|
|
25
|
+
topic: Topic;
|
|
26
|
+
/** The topic's last message. */
|
|
27
|
+
lastMessage?: Message;
|
|
28
28
|
}
|
|
29
|
+
//# sourceMappingURL=B_topic_list_item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"B_topic_list_item.d.ts","sourceRoot":"","sources":["../../src/types/B_topic_list_item.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,+BAA+B;AAC/B,MAAM,WAAW,aAAa;IAC5B,iBAAiB;IACjB,KAAK,EAAE,KAAK,CAAC;IACb,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|