Hi there,
This package is just fantastic. I have it working really well at the moment. Just noticed one thing that I'm not sure is actually broken but I'll run it past you.
The official docs state:

So in my mind, you should receive a message, when you go to reply, the custom keyboard appears and you can select your option but then the keyboard is GONE and doesn't come back.
When I try this code:
$keyboard = [
['Yes', 'No', 'Maybe'],
["I'm Not Sure", 'Can You'],
['Repeat the question?']
];
$response = Telegram::sendMessage('<myid>', 'Hello!', false, null, Telegram::replyKeyboardMarkup($keyboard, true, true, false));
I get my message perfectly and the custom keyboard pops up:

However when I press my reply, the custom keyboard icon doesn't disappear:

Pressing on this icon brings up the custom keyboard all the time.
The only way to remove the custom keyboard is to send a new message with
$response = Telegram::sendMessage('<myid>', 'Just removing the keyboard', false, null, Telegram::replyKeyboardHide());
Now instantly it disappears:

Is this intentional or is there a bug with how the one-time-keyboard should work?
Hi @jonnywilliamson,
Thanks for posting the info.
I just tried this too and it seems to be like either intentionally done or a bug from their end.
Their official BotFather also shows up the keyboard but then hides after we reply. Now I'm not sure whether they are making replyKeyboardHide call behind the scenes after they get a response from the user or if its from the one_time_keyboard method within the markup itself.
It's not a bug from library though, Because i tried several methods directly and it still doesn't work like expected. I've left a message to their support, lets see what they say!
Will keep this open till we conclude something.
So few more tests and i think this is how its designed. When it says one time keyboard, It simply shows up the keyboard once till the user responds and keeps it hidden within that icon so you could retrieve it again for whatever reasons and reuse it. Whereas if it's not set or is false, then it always shows that keyboard till another one is set. Makes sense.
@irazasyed Thanks for getting back to me and testing the problem out!
It's interesting as in my opinion it still doesn't seem right (although none of this is to do with your library). If you think about the following I think you'll see what I mean.


So basically as soon as a custom keyboard comes through to a user they lose the ability to view/send commands easily (they can always do so manually).
Seems poor? Or perhaps this is just an iOS thing and it works better on Android.
@jonnywilliamson No probs!
So looking at your explanation point by point, It's right but i also think it's poorly designed (The API + the UI). Because Telegram for Mac shows up both the icons, see below screenshot:

Since the API itself is still very new, It may take some time to improve this much better. I was told, they are working on to improve the same in coming months along with new features, etc.
I've sent this issue ticket link to their support. Hopefully they review this thread and maybe give their input.
@irazasyed Cool!
Thanks for chasing it up. I'm sure the API will improve a lot over the coming months as they update it.
Hey @jonnywilliamson So i just received a response from the support. Here's what they said:
It's working as intended (doesn't mean it might not be changed) the documentation will be updated to make clear when and how the hide works.
I'm going to be obstinate and say my way makes more sense that the "official way" ! Hehe.
Who knows. I'll keep an eye on the docs.
:+1:
Just wondering did anyone get my Malcolm in the Middle reference in this topic? :)
@jonnywilliamson Nope :smile:
Excuse me for intervention, I came from google search. Have the same issue with custom keyboard now. Did you solve problem with removing this? Is replyKeyboardHide only way?
I don't use this feature at the moment, but I haven't seen anything in the documentation that would suggest they have improved it.
Ah, google got me here and I feel the same as the person who posted this issue.
To hide custom keyboard just send next message with [hide_keyboard => true] array in the reply_markup:
[
'text' => '...'
'chat_id' => '...'
'reply_markup'=> ['hide_keyboard'=> true],
]
var keyboard = new ReplyKeyboardMarkup(new[]
{
new KeyboardButton("Share location please")
{
RequestLocation = true
}
});
long Chat_id = Bot.SendTextMessageAsync(message.Chat.Id, "Custom Text",false,false,0, replyMarkup: keyboard).Result.Chat.Id;
i used this code for send a keyboard to Client and client reply my message and its work fine on Android but in IOS we have a problem that when client click on Share Location Button that Location was sended is not reply
its just a Normal Location Message without Reply any other message
and its important for my Bot that receive "replied Location Message"
Actually i just Receive a Location without this => ReplyToMessage.MessageId; Value in C#
Well, it seems you also cant hide a normal keyboard and show an inline keyboard at the same time....
Long Story:
I recently added multiple language support to my bot, and I previously only used commands.
However since the bot got more functions, it would have like 20 commands in the suggestions,
wich is annoying for groups I think.
My bot wouldnt need the privacy feature off for normal functionaly, so I changed my "menu" style to inline buttons (instead of showing /commands with a normal keyboard).
Then I noticed it's a bit hard to pass arguments into the data field of those inline keyboard callbacks
and decided to leave some part of the menu with the /command keyboard instead of inline buttons.
And here is the problem: After I sent a message with 'keyboard': when I send a new message with an 'inline_keyboard', the previous 'keyboard' stays there and open despite 'one_time_keyboard' was included or including 'hide_keyboard' in the current request.
As I see this is clearly a misbehaviour and there is no way to fix this, beside sending two requests.
A workaround in my case is: to first sendMessage with 'hide_keyboard' and placeholder text and after that completed, editMessage with the actual text and inline_keyboard.
...but there definetley is still room for _improvement_,
Most helpful comment
To hide custom keyboard just send next message with [hide_keyboard => true] array in the reply_markup: