Skip to content

Commit

Permalink
update: sync to Bot API 7.8 and fix getData method for openswoole
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirHkrg committed Aug 13, 2024
1 parent e2adf99 commit f5b7f0a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Methode.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@ public function setChatDescription($chat_id, $description): bool|string|array|nu
return $this->endpoint('setChatDescription', get_defined_vars());
}

public function pinChatMessage($chat_id, $message_id, $disable_notification = null): bool|string|array|null
public function pinChatMessage($chat_id, $message_id, $disable_notification = null, $business_connection_id = null): bool|string|array|null
{
return $this->endpoint('pinChatMessage', get_defined_vars());
}

public function unpinChatMessage($chat_id, $message_id): bool|string|array|null
public function unpinChatMessage($chat_id, $message_id, $business_connection_id = null): bool|string|array|null
{
return $this->endpoint('unpinChatMessage', get_defined_vars());
}
Expand Down
3 changes: 3 additions & 0 deletions src/Updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ public function getData()
return json_decode($data['argv'][1]);
} elseif ((isset($_ENV['UPDATE_TYPE']) && $_ENV['UPDATE_TYPE'] == 'sync') || !isset($_ENV['UPDATE_TYPE'])) {
return json_decode(file_get_contents('php://input'));
} elseif (isset($_ENV['UPDATE_TYPE']) && $_ENV['UPDATE_TYPE'] == 'openswoole') {
global $swoole;
return $swoole;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Updates/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
* @property MaybeInaccessibleMessage $pinned_message
* @property Invoice $invoice
* @property SuccessfulPayment $successful_payment
* @property RefundedPayment $refunded_payment
* @property UsersShared $users_shared
* @property ChatShared $chat_shared
* @property string $connected_website
Expand All @@ -87,6 +88,5 @@
* @property VideoChatParticipantsInvited $video_chat_participants_invited
* @property WebAppData $web_app_data
* @property InlineKeyboardMarkup $reply_markup
**/
**/
class Message { }
13 changes: 13 additions & 0 deletions src/Updates/RefundedPayment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace LaraGram\Laraquest\Updates;

/**
* @property string $currency
* @property int $total_amount
* @property string $invoice_payload
* @property string $telegram_payment_charge_id
* @property string $provider_payment_charge_id
**/
class RefundedPayment { }
4 changes: 2 additions & 2 deletions src/Updates/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
* @property bool $can_read_all_group_messages
* @property bool $supports_inline_queries
* @property bool $can_connect_to_business
**/
* @property bool $has_main_web_app
**/
class User { }

0 comments on commit f5b7f0a

Please sign in to comment.