Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #21 from WaffleLapkin/trim_args
Browse files Browse the repository at this point in the history
Trim arguments of commands
  • Loading branch information
WaffleLapkin authored Feb 7, 2022
2 parents 0d4d266 + e79f27b commit 10a9dda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crate_upd_bot"
version = "0.1.9"
version = "0.1.10"
authors = ["Waffle <[email protected]>"]
edition = "2018"

Expand Down
3 changes: 2 additions & 1 deletion src/bot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{fmt::Debug, ops::Not, path::PathBuf, sync::Arc};
use fntools::value::ValueExt;
use futures::{future, Future, FutureExt};
use teloxide::{
payloads::SendMessageSetters,
prelude::{Requester, *},
types::{Me, Message},
utils::command::{BotCommand, ParseError},
Expand Down Expand Up @@ -285,7 +286,7 @@ where
fn opt(input: String) -> Result<(Option<String>,), ParseError> {
match input.split_whitespace().count() {
0 => Ok((None,)),
1 => Ok((Some(input),)),
1 => Ok((Some(input.trim().to_owned()),)),
n => Err(ParseError::TooManyArguments {
expected: 1,
found: n,
Expand Down

0 comments on commit 10a9dda

Please sign in to comment.