Skip to content

Commit

Permalink
Bot API 7.0: Replies 2.0 (#129)
Browse files Browse the repository at this point in the history
* API 7: replies 2.0

* Bot API 7.0: Link Preview Customization (#130)

* Bot API 7.0: Link Preview Customization

* Bot API 7.0: Multiple Message Actions (#131)

* Bot API 7.0: Multiple Message Actions

* Bot API 7.0: Request for multiple users (#132)

* Bot API 7.0: Request for multiple users

* Bot API 7.0: Chat Boost (#133)

* Bot API 7.0: Chat Boost

* Bot API 7.0: Giveaway (#134)

* Bot API 7.0: Giveaway

* Bot API 7.0: Other changes (#135)
  • Loading branch information
ayrat555 authored Jan 6, 2024
1 parent 8098a51 commit 8179a5f
Show file tree
Hide file tree
Showing 6 changed files with 604 additions and 126 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
7 changes: 6 additions & 1 deletion examples/reply_to_message_updates.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use frankenstein::GetUpdatesParams;
use frankenstein::ReplyParameters;
use frankenstein::SendMessageParams;
use frankenstein::TelegramApi;
use frankenstein::{Api, UpdateContent};
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
Loading

0 comments on commit 8179a5f

Please sign in to comment.