Skip to content

Commit

Permalink
Change bot cmd number param values from u16 to f64 (#7095)
Browse files Browse the repository at this point in the history
  • Loading branch information
megrogan authored Dec 19, 2024
1 parent 91631eb commit a70fae7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 4 additions & 0 deletions backend/canisters/local_user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [unreleased]

### Changed

- Change bot cmd number param values from u16 to f64 ([#7095](https://github.com/open-chat-labs/open-chat/pull/7095))

## [[2.0.1530](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1530-local_user_index)] - 2024-12-19

### Added
Expand Down
1 change: 1 addition & 0 deletions backend/canisters/user_index/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Handle retry attempts when adding a new LocalUserIndex ([#7091](https://github.com/open-chat-labs/open-chat/pull/7091))
- Add logging + skip steps that have already been completed ([#7093](https://github.com/open-chat-labs/open-chat/pull/7093))
- Change bot cmd number param values from u16 to f64 ([#7095](https://github.com/open-chat-labs/open-chat/pull/7095))

## [[2.0.1533](https://github.com/open-chat-labs/open-chat/releases/tag/v2.0.1533-user_index)] - 2024-12-19

Expand Down
6 changes: 3 additions & 3 deletions backend/libraries/types/can.did
Original file line number Diff line number Diff line change
Expand Up @@ -2117,14 +2117,14 @@ type StringParamChoice = record {
};

type NumberParam = record {
min_length : nat16;
max_length : nat16;
min_value : float64;
max_value : float64;
choices : vec NumberParamChoice;
};

type NumberParamChoice = record {
name : text;
value : nat16;
value : float64;
};

type SlashCommandPermissions = record {
Expand Down
10 changes: 5 additions & 5 deletions backend/libraries/types/src/bots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ pub struct StringParam {
#[ts_export]
#[derive(CandidType, Serialize, Deserialize, Debug, Clone)]
pub struct NumberParam {
pub min_length: u16,
pub max_length: u16,
#[ts(as = "Vec<SlashCommandOptionChoiceU16>")]
pub choices: Vec<SlashCommandOptionChoice<u16>>,
pub min_value: f64,
pub max_value: f64,
#[ts(as = "Vec<SlashCommandOptionChoiceF64>")]
pub choices: Vec<SlashCommandOptionChoice<f64>>,
}

#[ts_export]
Expand Down Expand Up @@ -104,7 +104,7 @@ macro_rules! slash_command_option_choice {
}

slash_command_option_choice!(SlashCommandOptionChoiceString, String);
slash_command_option_choice!(SlashCommandOptionChoiceU16, u16);
slash_command_option_choice!(SlashCommandOptionChoiceF64, f64);

#[ts_export]
#[derive(CandidType, Serialize, Deserialize, Debug)]
Expand Down

0 comments on commit a70fae7

Please sign in to comment.