Now fully trimming the text of the message in the state handlers
This commit is contained in:
parent
24420096fd
commit
fff91dc498
@ -26,7 +26,7 @@ where
|
||||
delete_optional(&bot, handler.previous.as_ref()).await;
|
||||
|
||||
let text = match msg.text() {
|
||||
Some(text) => text.trim_end(),
|
||||
Some(text) => text.trim(),
|
||||
None => {
|
||||
let msg = bot.send_message(msg.chat.id, no_text_message).await?;
|
||||
handler.previous = Some(msg);
|
||||
|
@ -40,7 +40,7 @@ pub async fn get_existing_name(
|
||||
delete_optional(&bot, handler.previous.as_ref()).await;
|
||||
|
||||
let text = match msg.text() {
|
||||
Some(text) => text.trim_end(),
|
||||
Some(text) => text.trim(),
|
||||
None => {
|
||||
let msg = bot
|
||||
.send_message(
|
||||
|
@ -125,7 +125,7 @@ pub async fn get_user(
|
||||
let mut handler = next.lock().await;
|
||||
delete_optional(&bot, handler.previous.as_ref()).await;
|
||||
|
||||
if let Some("/cancel") = msg.text().map(str::trim_end) {
|
||||
if let Some("/cancel") = msg.text().map(str::trim) {
|
||||
dialogue.exit().await?;
|
||||
bot.send_message(msg.chat.id, "Successfully cancelled")
|
||||
.reply_markup(deletion_markup())
|
||||
|
Loading…
Reference in New Issue
Block a user