Skip to content

Commit

Permalink
fix async example
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Jan 1, 2024
1 parent 264ca49 commit da14c54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/async_reply_to_message_updates.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use frankenstein::AsyncTelegramApi;
use frankenstein::GetUpdatesParams;
use frankenstein::Message;
use frankenstein::ReplyParameters;
use frankenstein::SendMessageParams;
use frankenstein::{AsyncApi, UpdateContent};

Expand Down Expand Up @@ -42,10 +43,14 @@ async fn main() {
}

async fn process_message(message: Message, api: AsyncApi) {
let reply_parameters = ReplyParameters::builder()
.message_id(message.message_id)
.build();

let send_message_params = SendMessageParams::builder()
.chat_id(message.chat.id)
.text("hello")
.reply_to_message_id(message.message_id)
.reply_parameters(reply_parameters)
.build();

if let Err(err) = api.send_message(&send_message_params).await {
Expand Down
2 changes: 1 addition & 1 deletion examples/reply_to_message_updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use frankenstein::SendMessageParams;
use frankenstein::TelegramApi;
use frankenstein::{Api, UpdateContent};

static TOKEN: &str = "1276618370:AAGx5YhNQvUG4eUcQXN-OB_a09ZzYl6uh6o";
static TOKEN: &str = "API_TOKEN";

fn main() {
let api = Api::new(TOKEN);
Expand Down

0 comments on commit da14c54

Please sign in to comment.