refactor: extend channel to carry voice note bytes
This commit is contained in:
parent
d66e004b0d
commit
54764935c2
3 changed files with 6 additions and 6 deletions
|
|
@ -18,8 +18,8 @@ async fn notify(bot: &Bot, chat_id: ChatId, entry: &Entry) {
|
|||
}
|
||||
|
||||
/// Listen for new entries on the channel and send Telegram notifications.
|
||||
pub async fn notification_task(bot: Bot, chat_id: ChatId, mut rx: Receiver<(Entry, Option<Vec<u8>>)>) {
|
||||
while let Some((entry, drawing_bytes)) = rx.recv().await {
|
||||
pub async fn notification_task(bot: Bot, chat_id: ChatId, mut rx: Receiver<(Entry, Option<Vec<u8>>, Option<Vec<u8>>)>) {
|
||||
while let Some((entry, drawing_bytes, _voice_bytes)) = rx.recv().await {
|
||||
notify(&bot, chat_id, &entry).await;
|
||||
if let Some(bytes) = drawing_bytes {
|
||||
if let Err(e) = bot.send_photo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue