From c70ffd095a6de5cd5b872796a0d82a8c5afc1511 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Sat, 20 Jul 2024 17:22:25 +0300 Subject: Initial commit --- src/types/chat_member.zig | 63 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/types/chat_member.zig (limited to 'src/types/chat_member.zig') 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 @@ +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"); +}; -- cgit v1.2.3