From 7b81649c566b55b3ced21ffe71d461f2279db7e2 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 28 Oct 2024 05:09:20 +0100 Subject: [PATCH] I looked everywhere but couldn't find who asked --- src/services/telegram/commands/diario.rs | 2 +- src/services/telegram/commands/fortune.rs | 6 +++--- src/services/telegram/commands/mod.rs | 2 +- src/services/telegram/commands/start.rs | 4 ++-- src/services/telegram/commands/whoami.rs | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/services/telegram/commands/diario.rs b/src/services/telegram/commands/diario.rs index 340722ce..b01573c9 100644 --- a/src/services/telegram/commands/diario.rs +++ b/src/services/telegram/commands/diario.rs @@ -104,7 +104,7 @@ impl TelegramWrite for Diario { pub async fn handler(bot: &Bot, message: &Message, args: &DiarioArgs, database: &DatabaseInterface) -> CommandResult { let author = message.from.as_ref() - .context("Non è stato possibile determinare chi ha inviato questo comando.")?; + .context("Non è stato possibile determinare chi abbia inviato il comando.")?; let mut database = database.connect()?; diff --git a/src/services/telegram/commands/fortune.rs b/src/services/telegram/commands/fortune.rs index c77bcee0..2c776547 100644 --- a/src/services/telegram/commands/fortune.rs +++ b/src/services/telegram/commands/fortune.rs @@ -2,12 +2,12 @@ use std::hash::{Hash, Hasher}; use anyhow::Context; use chrono::Datelike; -use rand::SeedableRng; use rand::seq::SliceRandom; -use teloxide::Bot; +use rand::SeedableRng; use teloxide::payloads::SendMessageSetters; use teloxide::prelude::{Message, Requester}; use teloxide::types::ReplyParameters; +use teloxide::Bot; use crate::services::telegram::commands::CommandResult; @@ -198,7 +198,7 @@ pub async fn handler(bot: &Bot, message: &Message) -> CommandResult { let today = chrono::Local::now().date_naive(); let author = message.from.as_ref() - .context("Non è stato possibile determinare chi ha inviato questo comando.")?; + .context("Non è stato possibile determinare chi abbia inviato il comando.")?; let author_id = author.id; let key = FortuneKey { today, author_id }; diff --git a/src/services/telegram/commands/mod.rs b/src/services/telegram/commands/mod.rs index 3ffd1144..000058f0 100644 --- a/src/services/telegram/commands/mod.rs +++ b/src/services/telegram/commands/mod.rs @@ -26,7 +26,7 @@ pub mod cat; pub mod roll; pub mod diario; pub mod matchmaking; - +mod quote; type CommandResult = AnyResult<()>; diff --git a/src/services/telegram/commands/start.rs b/src/services/telegram/commands/start.rs index da23e28f..601ce1a6 100644 --- a/src/services/telegram/commands/start.rs +++ b/src/services/telegram/commands/start.rs @@ -1,14 +1,14 @@ use anyhow::Context; -use teloxide::Bot; use teloxide::payloads::SendMessageSetters; use teloxide::requests::Requester; use teloxide::types::{Message, ReplyParameters}; +use teloxide::Bot; use super::CommandResult; pub async fn handler(bot: &Bot, message: &Message) -> CommandResult { let author = message.from.as_ref() - .context("Non è stato possibile determinare chi ha inviato questo comando.")?; + .context("Non è stato possibile determinare chi abbia inviato il comando.")?; let author_username = match author.username.as_ref() { None => { diff --git a/src/services/telegram/commands/whoami.rs b/src/services/telegram/commands/whoami.rs index 638974c8..8f05f99c 100644 --- a/src/services/telegram/commands/whoami.rs +++ b/src/services/telegram/commands/whoami.rs @@ -1,8 +1,8 @@ use anyhow::Context; -use teloxide::Bot; use teloxide::payloads::SendMessageSetters; use teloxide::requests::Requester; use teloxide::types::{Message, ParseMode, ReplyParameters}; +use teloxide::Bot; use crate::interfaces::database::models::RoyalnetUser; use crate::services::telegram::dependencies::interface_database::DatabaseInterface; @@ -12,7 +12,7 @@ use super::CommandResult; pub async fn handler(bot: &Bot, message: &Message, database: &DatabaseInterface) -> CommandResult { let author = message.from.as_ref() - .context("Non è stato possibile determinare chi ha inviato questo comando.")?; + .context("Non è stato possibile determinare chi abbia inviato il comando.")?; let mut database = database.connect()?;