diff options
| author | 2024-07-27 05:56:48 +0300 | |
|---|---|---|
| committer | 2024-07-27 05:58:51 +0300 | |
| commit | 98abaf3d19631f1280b83467d38f28b150a02a3a (patch) | |
| tree | fdf3094c3c18421d9ee23c244a668f2e274a9b57 /src/types | |
| parent | Send a different GIF when bot gets added (diff) | |
| download | ukkobot-98abaf3d19631f1280b83467d38f28b150a02a3a.tar.gz ukkobot-98abaf3d19631f1280b83467d38f28b150a02a3a.tar.xz ukkobot-98abaf3d19631f1280b83467d38f28b150a02a3a.zip | |
Add a default values to (hopefully) all nullable fields
Diffstat (limited to 'src/types')
| -rw-r--r-- | src/types/ChatInviteLink.zig | 8 | ||||
| -rw-r--r-- | src/types/ChatJoinRequest.zig | 4 | ||||
| -rw-r--r-- | src/types/ChosenInlineResult.zig | 2 | ||||
| -rw-r--r-- | src/types/Document.zig | 4 | ||||
| -rw-r--r-- | src/types/EncryptedPassportElement.zig | 16 | ||||
| -rw-r--r-- | src/types/InlineQuery.zig | 4 | ||||
| -rw-r--r-- | src/types/PollAnswer.zig | 4 | ||||
| -rw-r--r-- | src/types/PreCheckoutQuery.zig | 4 | ||||
| -rw-r--r-- | src/types/SwitchInlineQueryChosenChat.zig | 2 | ||||
| -rw-r--r-- | src/types/message_origin.zig | 4 |
10 files changed, 26 insertions, 26 deletions
diff --git a/src/types/ChatInviteLink.zig b/src/types/ChatInviteLink.zig index 41a1f44..232ddcc 100644 --- a/src/types/ChatInviteLink.zig +++ b/src/types/ChatInviteLink.zig | |||
| @@ -5,7 +5,7 @@ creator: User, | |||
| 5 | creates_join_request: bool, | 5 | creates_join_request: bool, |
| 6 | is_primary: bool, | 6 | is_primary: bool, |
| 7 | is_revoked: bool, | 7 | is_revoked: bool, |
| 8 | name: ?[]const u8, | 8 | name: ?[]const u8 = null, |
| 9 | expire_date: ?u64, | 9 | expire_date: ?u64 = null, |
| 10 | member_limit: ?u64, | 10 | member_limit: ?u64 = null, |
| 11 | pending_join_request_count: ?u64, | 11 | pending_join_request_count: ?u64 = null, |
diff --git a/src/types/ChatJoinRequest.zig b/src/types/ChatJoinRequest.zig index f08e070..194871d 100644 --- a/src/types/ChatJoinRequest.zig +++ b/src/types/ChatJoinRequest.zig | |||
| @@ -6,5 +6,5 @@ chat: Chat, | |||
| 6 | from: User, | 6 | from: User, |
| 7 | user_chat_id: i64, | 7 | user_chat_id: i64, |
| 8 | date: u64, | 8 | date: u64, |
| 9 | bio: ?[]const u8, | 9 | bio: ?[]const u8 = null, |
| 10 | invite_link: ?ChatInviteLink, | 10 | invite_link: ?ChatInviteLink = null, |
diff --git a/src/types/ChosenInlineResult.zig b/src/types/ChosenInlineResult.zig index e0528cd..46ba207 100644 --- a/src/types/ChosenInlineResult.zig +++ b/src/types/ChosenInlineResult.zig | |||
| @@ -4,5 +4,5 @@ const User = @import("User.zig"); | |||
| 4 | result_id: []const u8, | 4 | result_id: []const u8, |
| 5 | from: User, | 5 | from: User, |
| 6 | location: ?Location = null, | 6 | location: ?Location = null, |
| 7 | inline_message_id: ?[]const u8, | 7 | inline_message_id: ?[]const u8 = null, |
| 8 | query: []const u8, | 8 | query: []const u8, |
diff --git a/src/types/Document.zig b/src/types/Document.zig index 811273d..e4d6a32 100644 --- a/src/types/Document.zig +++ b/src/types/Document.zig | |||
| @@ -3,6 +3,6 @@ const PhotoSize = @import("PhotoSize.zig"); | |||
| 3 | file_id: []const u8, | 3 | file_id: []const u8, |
| 4 | file_unique_id: []const u8, | 4 | file_unique_id: []const u8, |
| 5 | thumbnail: ?PhotoSize = null, | 5 | thumbnail: ?PhotoSize = null, |
| 6 | file_name: ?[]const u8, | 6 | file_name: ?[]const u8 = null, |
| 7 | mime_type: ?[]const u8, | 7 | mime_type: ?[]const u8 = null, |
| 8 | file_size: ?u64 = null, | 8 | file_size: ?u64 = null, |
diff --git a/src/types/EncryptedPassportElement.zig b/src/types/EncryptedPassportElement.zig index ca0e2ed..2f9c5fd 100644 --- a/src/types/EncryptedPassportElement.zig +++ b/src/types/EncryptedPassportElement.zig | |||
| @@ -19,12 +19,12 @@ pub const Type = enum { | |||
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | type: Type, | 21 | type: Type, |
| 22 | data: ?[]const u8, | 22 | data: ?[]const u8 = null, |
| 23 | phone_number: ?[]const u8, | 23 | phone_number: ?[]const u8 = null, |
| 24 | email: ?[]const u8, | 24 | email: ?[]const u8 = null, |
| 25 | files: ?[]PassportFile, | 25 | files: ?[]PassportFile = null, |
| 26 | front_side: ?PassportFile, | 26 | front_side: ?PassportFile = null, |
| 27 | reverse_side: ?PassportFile, | 27 | reverse_side: ?PassportFile = null, |
| 28 | selfie: ?PassportFile, | 28 | selfie: ?PassportFile = null, |
| 29 | translation: ?[]PassportFile, | 29 | translation: ?[]PassportFile = null, |
| 30 | hash: []const u8, | 30 | hash: []const u8, |
diff --git a/src/types/InlineQuery.zig b/src/types/InlineQuery.zig index 7cbbe20..47da2cb 100644 --- a/src/types/InlineQuery.zig +++ b/src/types/InlineQuery.zig | |||
| @@ -13,5 +13,5 @@ id: []const u8, | |||
| 13 | from: User, | 13 | from: User, |
| 14 | query: []const u8, | 14 | query: []const u8, |
| 15 | offset: []const u8, | 15 | offset: []const u8, |
| 16 | chat_type: ?ChatType, | 16 | chat_type: ?ChatType = null, |
| 17 | location: ?Location, | 17 | location: ?Location = null, |
diff --git a/src/types/PollAnswer.zig b/src/types/PollAnswer.zig index 7d4985c..f6aca35 100644 --- a/src/types/PollAnswer.zig +++ b/src/types/PollAnswer.zig | |||
| @@ -2,6 +2,6 @@ const Chat = @import("Chat.zig"); | |||
| 2 | const User = @import("User.zig"); | 2 | const User = @import("User.zig"); |
| 3 | 3 | ||
| 4 | poll_id: []const u8, | 4 | poll_id: []const u8, |
| 5 | voter_chat: ?Chat, | 5 | voter_chat: ?Chat = null, |
| 6 | user: ?User, | 6 | user: ?User = null, |
| 7 | option_ids: []u64, | 7 | option_ids: []u64, |
diff --git a/src/types/PreCheckoutQuery.zig b/src/types/PreCheckoutQuery.zig index 48e013f..fe80ce5 100644 --- a/src/types/PreCheckoutQuery.zig +++ b/src/types/PreCheckoutQuery.zig | |||
| @@ -6,5 +6,5 @@ from: User, | |||
| 6 | currency: []const u8, | 6 | currency: []const u8, |
| 7 | total_amount: u64, | 7 | total_amount: u64, |
| 8 | invoice_payload: []const u8, | 8 | invoice_payload: []const u8, |
| 9 | shipping_option_id: ?[]const u8, | 9 | shipping_option_id: ?[]const u8 = null, |
| 10 | order_info: ?OrderInfo, | 10 | order_info: ?OrderInfo = null, |
diff --git a/src/types/SwitchInlineQueryChosenChat.zig b/src/types/SwitchInlineQueryChosenChat.zig index 860f2d9..404b08e 100644 --- a/src/types/SwitchInlineQueryChosenChat.zig +++ b/src/types/SwitchInlineQueryChosenChat.zig | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | query: ?[]const u8, | 1 | query: ?[]const u8 = null, |
| 2 | allow_user_chats: ?bool = null, | 2 | allow_user_chats: ?bool = null, |
| 3 | allow_bot_chats: ?bool = null, | 3 | allow_bot_chats: ?bool = null, |
| 4 | allow_group_chats: ?bool = null, | 4 | allow_group_chats: ?bool = null, |
diff --git a/src/types/message_origin.zig b/src/types/message_origin.zig index 5ca1f9f..96af076 100644 --- a/src/types/message_origin.zig +++ b/src/types/message_origin.zig | |||
| @@ -15,13 +15,13 @@ pub const MessageOrigin = union(enum) { | |||
| 15 | chat: struct { | 15 | chat: struct { |
| 16 | date: u64, | 16 | date: u64, |
| 17 | sender_chat: Chat, | 17 | sender_chat: Chat, |
| 18 | author_signature: ?[]const u8, | 18 | author_signature: ?[]const u8 = null, |
| 19 | }, | 19 | }, |
| 20 | channel: struct { | 20 | channel: struct { |
| 21 | date: u64, | 21 | date: u64, |
| 22 | chat: Chat, | 22 | chat: Chat, |
| 23 | message_id: u64, | 23 | message_id: u64, |
| 24 | author_signature: ?[]const u8, | 24 | author_signature: ?[]const u8 = null, |
| 25 | }, | 25 | }, |
| 26 | 26 | ||
| 27 | pub const jsonParse = json.makeJsonParse(MessageOrigin); | 27 | pub const jsonParse = json.makeJsonParse(MessageOrigin); |