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

Bot API 7.0 #128

Merged
merged 5 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
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