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

Switch to i64 in methods associated with CreateCommandOption #2668

Merged
merged 1 commit into from
Dec 22, 2023
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
8 changes: 4 additions & 4 deletions src/builder/create_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl CreateCommandOption {
///
/// **Note**: There can be no more than 25 choices set. Name must be between 1 and 100
/// characters. Value must be between -2^53 and 2^53.
pub fn add_int_choice(self, name: impl Into<String>, value: i32) -> Self {
pub fn add_int_choice(self, name: impl Into<String>, value: i64) -> Self {
self.add_choice(CommandOptionChoice {
name: name.into().into(),
value: Value::from(value),
Expand All @@ -126,7 +126,7 @@ impl CreateCommandOption {
pub fn add_int_choice_localized(
self,
name: impl Into<String>,
value: i32,
value: i64,
locales: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self {
self.add_choice(CommandOptionChoice {
Expand Down Expand Up @@ -248,13 +248,13 @@ impl CreateCommandOption {
}

/// Sets the minimum permitted value for this integer option
pub fn min_int_value(mut self, value: u64) -> Self {
pub fn min_int_value(mut self, value: i64) -> Self {
self.0.min_value = Some(value.into());
self
}

/// Sets the maximum permitted value for this integer option
pub fn max_int_value(mut self, value: u64) -> Self {
pub fn max_int_value(mut self, value: i64) -> Self {
self.0.max_value = Some(value.into());
self
}
Expand Down