summaryrefslogtreecommitdiff
path: root/src/types/chat_member.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/chat_member.zig')
-rw-r--r--src/types/chat_member.zig63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/types/chat_member.zig b/src/types/chat_member.zig
new file mode 100644
index 0000000..7650299
--- /dev/null
+++ b/src/types/chat_member.zig
@@ -0,0 +1,63 @@
1const json = @import("../json.zig");
2
3const User = @import("User.zig");
4
5pub const ChatMember = union(enum) {
6 creator: struct {
7 user: User,
8 is_anonymous: bool,
9 custom_title: ?[]const u8 = null,
10 },
11 administrator: struct {
12 user: User,
13 can_be_edited: bool,
14 is_anonymous: bool,
15 can_manage_chat: bool,
16 can_delete_messages: bool,
17 can_manage_video_chats: bool,
18 can_restrict_members: bool,
19 can_promote_members: bool,
20 can_change_info: bool,
21 can_invite_users: bool,
22 can_post_stories: bool,
23 can_edit_stories: bool,
24 can_delete_stories: bool,
25 can_post_messages: ?bool = null,
26 can_edit_messages: ?bool = null,
27 can_pin_messages: ?bool = null,
28 can_manage_topics: ?bool = null,
29 custom_title: ?[]const u8 = null,
30 },
31 member: struct {
32 user: User,
33 },
34 restricted: struct {
35 user: User,
36 is_member: bool,
37 can_send_messages: bool,
38 can_send_audios: bool,
39 can_send_documents: bool,
40 can_send_photos: bool,
41 can_send_videos: bool,
42 can_send_video_notes: bool,
43 can_send_voice_notes: bool,
44 can_send_polls: bool,
45 can_send_other_messages: bool,
46 can_add_web_page_previews: bool,
47 can_change_info: bool,
48 can_invite_users: bool,
49 can_pin_messages: bool,
50 can_manage_topics: bool,
51 until_date: u64,
52 },
53 left: struct {
54 user: User,
55 },
56 banned: struct {
57 user: User,
58 until_date: u64,
59 },
60
61 pub const jsonParse = json.makeJsonParse(ChatMember);
62 pub const jsonParseFromValue = json.makeJsonParseFromValueWithTag(ChatMember, "status");
63};