summaryrefslogtreecommitdiff
path: root/src/types/chat_member.zig
blob: 76502992463c4868b5a00743f8ee7121793987e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
const json = @import("../json.zig");

const User = @import("User.zig");

pub const ChatMember = union(enum) {
    creator: struct {
        user: User,
        is_anonymous: bool,
        custom_title: ?[]const u8 = null,
    },
    administrator: struct {
        user: User,
        can_be_edited: bool,
        is_anonymous: bool,
        can_manage_chat: bool,
        can_delete_messages: bool,
        can_manage_video_chats: bool,
        can_restrict_members: bool,
        can_promote_members: bool,
        can_change_info: bool,
        can_invite_users: bool,
        can_post_stories: bool,
        can_edit_stories: bool,
        can_delete_stories: bool,
        can_post_messages: ?bool = null,
        can_edit_messages: ?bool = null,
        can_pin_messages: ?bool = null,
        can_manage_topics: ?bool = null,
        custom_title: ?[]const u8 = null,
    },
    member: struct {
        user: User,
    },
    restricted: struct {
        user: User,
        is_member: bool,
        can_send_messages: bool,
        can_send_audios: bool,
        can_send_documents: bool,
        can_send_photos: bool,
        can_send_videos: bool,
        can_send_video_notes: bool,
        can_send_voice_notes: bool,
        can_send_polls: bool,
        can_send_other_messages: bool,
        can_add_web_page_previews: bool,
        can_change_info: bool,
        can_invite_users: bool,
        can_pin_messages: bool,
        can_manage_topics: bool,
        until_date: u64,
    },
    left: struct {
        user: User,
    },
    banned: struct {
        user: User,
        until_date: u64,
    },

    pub const jsonParse = json.makeJsonParse(ChatMember);
    pub const jsonParseFromValue = json.makeJsonParseFromValueWithTag(ChatMember, "status");
};