Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use i64 for ChatShared::chat_id #162

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ pub struct UsersShared {
pub struct ChatShared {
pub request_id: i32,

pub chat_id: u64,
pub chat_id: i64,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pub enum ChatId {

Suggested change
pub chat_id: i64,
pub chat_id: ChatId,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this enum is intended to be used solely in requests (as the file name suggests: API params). Is it supposed to be used to parse response data too? All other received chat IDs are parsed as i64 and u64

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Then I guess i64 is the way to go.


#[serde(skip_serializing_if = "Option::is_none")]
#[builder(setter(into, strip_option), default)]
Expand Down