Small fixes

This commit is contained in:
LasterAlex 2024-08-16 22:02:04 +03:00
parent da2ce2b116
commit 18920b546f
No known key found for this signature in database

View file

@ -15,7 +15,7 @@ use teloxide::{
dispatching::dialogue::{self, InMemStorage}, dispatching::dialogue::{self, InMemStorage},
macros::BotCommands, macros::BotCommands,
prelude::*, prelude::*,
types::Me, types::{Me, ParseMode},
}; };
pub type MyDialogue = Dialogue<State, InMemStorage<State>>; pub type MyDialogue = Dialogue<State, InMemStorage<State>>;
@ -33,7 +33,6 @@ pub enum State {
#[derive(BotCommands, Clone, Debug)] #[derive(BotCommands, Clone, Debug)]
#[command(rename_rule = "lowercase")] #[command(rename_rule = "lowercase")]
pub enum StartCommand { pub enum StartCommand {
#[command()]
Start(String), Start(String),
} }
@ -111,7 +110,7 @@ pub async fn send_message(
// Trying to send a message to the user // Trying to send a message to the user
let sent_result = bot let sent_result = bot
.send_message(id, format!("You have a new message!\n\n<i>{text}</i>")) .send_message(id, format!("You have a new message!\n\n<i>{text}</i>"))
.parse_mode(teloxide::types::ParseMode::Html) .parse_mode(ParseMode::Html)
.await; .await;
// And if no error is returned, success! // And if no error is returned, success!