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

Typed bot commands #152

Closed
Hirrolot opened this issue Feb 12, 2020 · 0 comments · Fixed by #205
Closed

Typed bot commands #152

Hirrolot opened this issue Feb 12, 2020 · 0 comments · Fixed by #205
Assignees
Labels
FIXME K-enhancement Kind: enchantment (new feature or request)

Comments

@Hirrolot
Copy link
Collaborator

Hirrolot commented Feb 12, 2020

Use typed arguments instead of just strings:

#[derive(BotCommand)]
enum Command {
    A(i32),
    B(String, f64),
    C(MyRandomType),
}

The variant's data must implement FromStr.

@Hirrolot Hirrolot added K-enhancement Kind: enchantment (new feature or request) FIXME labels Feb 12, 2020
WaffleLapkin added a commit that referenced this issue Nov 1, 2022
Improve `debug_assert!` message in `ChatId::unmark`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIXME K-enhancement Kind: enchantment (new feature or request)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants