Initial commit.

Signed-off-by: Pavel Kirilin <win10@list.ru>
This commit is contained in:
2023-02-20 01:20:41 +04:00
parent 9a04acd753
commit faae5e4898
39 changed files with 3420 additions and 2 deletions

View File

@ -0,0 +1,17 @@
use grammers_client::{Client, Update};
use crate::{bot::handlers::Handler, utils::messages::get_message};
#[derive(Clone)]
pub struct GetChatId;
#[async_trait::async_trait]
impl Handler for GetChatId {
async fn react(&self, _: &Client, update: &Update) -> anyhow::Result<()> {
let message = get_message(update);
if let Some(msg) = message {
msg.reply(msg.chat().id().to_string()).await?;
}
Ok(())
}
}

View File

@ -0,0 +1,17 @@
use grammers_client::{Client, Update};
use crate::bot::handlers::Handler;
#[derive(Clone)]
pub struct Help;
#[async_trait::async_trait]
impl Handler for Help {
async fn react(&self, _: &Client, update: &Update) -> anyhow::Result<()> {
let Update::NewMessage(message) = update else {return Ok(())};
message.reply("Хелпа").await?;
Ok(())
}
}

View File

@ -0,0 +1,2 @@
pub mod get_chat_id;
pub mod help;