这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dimaodnokoz
Copy link
Collaborator

@dimaodnokoz dimaodnokoz commented Nov 26, 2024

I think json_encode should be on the side of this package, because the code

$params['reply_markup'] = (string) $params['reply_markup'];

in vendor/irazasyed/telegram-bot-sdk/src/Traits/Http.php:137
works well for reply_markup, which is built according to their docs here
https://telegram-bot-sdk.com/docs/guides/keyboards

Update manually tested for:

'reply_markup' => [
'keyboard' => [
['q', '1'],
['2'],
],
'resize_keyboard' => true,
'is_persistent' => true,
],

//==============================

'reply_markup' => [
'keyboard' => [
[''],
],
'resize_keyboard' => true,
'is_persistent' => true,
],

//==============================

'reply_markup' => [
'keyboard' => [
[],
],
'resize_keyboard' => true,
'is_persistent' => true,
],

//==============================

'reply_markup' => [
'keyboard' => [],
'resize_keyboard' => true,
'is_persistent' => true,
],

//==============================

'reply_markup' => [
'resize_keyboard' => true,
'is_persistent' => true,
],

//==============================

'reply_markup' => [],

@codecov
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 51.82%. Comparing base (0efd47f) to head (bd658b5).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/Dialog.php 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #37      +/-   ##
============================================
- Coverage     52.39%   51.82%   -0.58%     
- Complexity       90       92       +2     
============================================
  Files             8        8              
  Lines           271      274       +3     
============================================
  Hits            142      142              
- Misses          129      132       +3     
Flag Coverage Δ
phpunit 51.82% <0.00%> (-0.58%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@alies-dev alies-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @dimaodnokoz

Ideally, we need to add some tests for this functionality, I'll probably do it today later

@alies-dev alies-dev merged commit 73d3c52 into koot-labs:master Nov 27, 2024
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants