mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-22 02:54:21 +00:00
I looked everywhere but couldn't find who asked
This commit is contained in:
parent
6ac67514b0
commit
7b81649c56
5 changed files with 9 additions and 9 deletions
|
@ -104,7 +104,7 @@ impl TelegramWrite for Diario {
|
||||||
|
|
||||||
pub async fn handler(bot: &Bot, message: &Message, args: &DiarioArgs, database: &DatabaseInterface) -> CommandResult {
|
pub async fn handler(bot: &Bot, message: &Message, args: &DiarioArgs, database: &DatabaseInterface) -> CommandResult {
|
||||||
let author = message.from.as_ref()
|
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()?;
|
let mut database = database.connect()?;
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ use std::hash::{Hash, Hasher};
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use chrono::Datelike;
|
use chrono::Datelike;
|
||||||
use rand::SeedableRng;
|
|
||||||
use rand::seq::SliceRandom;
|
use rand::seq::SliceRandom;
|
||||||
use teloxide::Bot;
|
use rand::SeedableRng;
|
||||||
use teloxide::payloads::SendMessageSetters;
|
use teloxide::payloads::SendMessageSetters;
|
||||||
use teloxide::prelude::{Message, Requester};
|
use teloxide::prelude::{Message, Requester};
|
||||||
use teloxide::types::ReplyParameters;
|
use teloxide::types::ReplyParameters;
|
||||||
|
use teloxide::Bot;
|
||||||
|
|
||||||
use crate::services::telegram::commands::CommandResult;
|
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 today = chrono::Local::now().date_naive();
|
||||||
|
|
||||||
let author = message.from.as_ref()
|
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 author_id = author.id;
|
||||||
|
|
||||||
let key = FortuneKey { today, author_id };
|
let key = FortuneKey { today, author_id };
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub mod cat;
|
||||||
pub mod roll;
|
pub mod roll;
|
||||||
pub mod diario;
|
pub mod diario;
|
||||||
pub mod matchmaking;
|
pub mod matchmaking;
|
||||||
|
mod quote;
|
||||||
|
|
||||||
type CommandResult = AnyResult<()>;
|
type CommandResult = AnyResult<()>;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use teloxide::Bot;
|
|
||||||
use teloxide::payloads::SendMessageSetters;
|
use teloxide::payloads::SendMessageSetters;
|
||||||
use teloxide::requests::Requester;
|
use teloxide::requests::Requester;
|
||||||
use teloxide::types::{Message, ReplyParameters};
|
use teloxide::types::{Message, ReplyParameters};
|
||||||
|
use teloxide::Bot;
|
||||||
|
|
||||||
use super::CommandResult;
|
use super::CommandResult;
|
||||||
|
|
||||||
pub async fn handler(bot: &Bot, message: &Message) -> CommandResult {
|
pub async fn handler(bot: &Bot, message: &Message) -> CommandResult {
|
||||||
let author = message.from.as_ref()
|
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() {
|
let author_username = match author.username.as_ref() {
|
||||||
None => {
|
None => {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use teloxide::Bot;
|
|
||||||
use teloxide::payloads::SendMessageSetters;
|
use teloxide::payloads::SendMessageSetters;
|
||||||
use teloxide::requests::Requester;
|
use teloxide::requests::Requester;
|
||||||
use teloxide::types::{Message, ParseMode, ReplyParameters};
|
use teloxide::types::{Message, ParseMode, ReplyParameters};
|
||||||
|
use teloxide::Bot;
|
||||||
|
|
||||||
use crate::interfaces::database::models::RoyalnetUser;
|
use crate::interfaces::database::models::RoyalnetUser;
|
||||||
use crate::services::telegram::dependencies::interface_database::DatabaseInterface;
|
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 {
|
pub async fn handler(bot: &Bot, message: &Message, database: &DatabaseInterface) -> CommandResult {
|
||||||
let author = message.from.as_ref()
|
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()?;
|
let mut database = database.connect()?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue