Use cache-me

This commit is contained in:
2023-05-06 23:39:11 +02:00
parent 6dac2be859
commit e58f45b776
11 changed files with 46 additions and 46 deletions

View File

@@ -1,4 +1,4 @@
use teloxide::{prelude::*, adaptors::Throttle};
use teloxide::{prelude::*, adaptors::{Throttle, CacheMe}};
use std::error::Error;
@@ -10,7 +10,7 @@ pub mod utils;
pub async fn message_handler(
message: Message,
bot: Throttle<Bot>,
bot: CacheMe<Throttle<Bot>>,
) -> Result<(), Box<dyn Error + Send + Sync>> {
let from_user = message.from().unwrap();
let text = message.text().unwrap_or("");