Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrat555 committed Jan 1, 2024
1 parent edb200c commit 264ca49
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/reply_to_message_updates.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use frankenstein::GetUpdatesParams;
use frankenstein::ReplyParameters;
use frankenstein::SendMessageParams;
use frankenstein::TelegramApi;
use frankenstein::{Api, UpdateContent};

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

fn main() {
let api = Api::new(TOKEN);
Expand All @@ -20,10 +21,14 @@ fn main() {
Ok(response) => {
for update in response.result {
if let UpdateContent::Message(message) = update.content {
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) {
Expand Down

0 comments on commit 264ca49

Please sign in to comment.