Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ChatInThread strategy and fix chat type in middleware #14

Merged
merged 2 commits into from
Apr 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix incorrect chat type
Desiders committed Apr 28, 2024
commit bae92ce68fdfd2baf2cffd423c9cace7959ea52f
4 changes: 2 additions & 2 deletions telers/src/middlewares/outer/fsm_context.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ use crate::{
Context, Storage,
},
router::Request,
types::User,
types::{Chat, User},
};

use async_trait::async_trait;
@@ -85,7 +85,7 @@ where
let message_thread_id = context.get("event_message_thread_id");

let user_id = user.and_then(|user| user.downcast_ref().map(|user: &User| user.id));
let chat_id = chat.and_then(|user| user.downcast_ref().map(|chat: &User| chat.id));
let chat_id = chat.and_then(|chat| chat.downcast_ref().map(|chat: &Chat| chat.id()));
let message_thread_id = message_thread_id
.and_then(|message_thread_id| message_thread_id.downcast_ref().copied());