8

I have this keyboard in my telegram bot:

enter image description here

When i click the right arrow i get this new keyboard:

enter image description here

the code is this:

    $url = $GLOBALS["website"]."/sendMessage?chat_id=".$chatID."&text=''&parse_mode=html&reply_markup=".json_encode($keyboard3);
    file_get_contents($url);

I know that text is required in sendmessage method, but i'm searching a way or workaround to send an empty message.

I've tried with space or similar html entity, but i did not suceed.

There is a way to do this?

Thank you.

sclero
  • 173
  • 1
  • 1
  • 8
  • It can not be done. If you want to navigate through menues without flooding your chat anytime you press a button you may want to have a look at inline_keyboards and working with callback data instead. – newsha Sep 16 '17 at 17:09
  • is there a way to put the white background for the inline_keyboards? – sclero Sep 16 '17 at 18:06
  • No, some form of text for inline_keyboards is mandatory. You can't have buttons with nothing on them. – newsha Sep 17 '17 at 07:33
  • I was referring to the background of the button, not the text. I wanted to have the white button with black text. I asked if it is possible to have the inline_keyboard with the white background and the black text. – sclero Sep 17 '17 at 17:21
  • Unfortunately no. Looks of buttons can not be changed. – newsha Sep 17 '17 at 17:31

5 Answers5

8

You can try Alt + 0173 in the Numpad. Press and hold the Alt key and click on 0 then 1 then 7 then 3.

S Pranaov
  • 81
  • 1
  • 2
4

You can't send empty message now, it was a bug for zero-width space and RTL (Right-to-Left) control character, but it can't send along now.

Sean Wei
  • 7,433
  • 1
  • 19
  • 39
4

Here is the current working empty symbol for Telegram, which works as a blank bubble message with sendMessage.

warfish
  • 613
  • 5
  • 20
2

I don't think there is a way to do what you want.

Consider this:

https://api.telegram.org/botYOURTOKEN/sendMessage?chat_id=ID&text=

Since even space is not accepted, there are no other characters that can be encoded to represent "nothingness".

andrea
  • 396
  • 2
  • 12
0

Click in the message field, hold "alt" and press 0713, this will enter a small character, release the alt key, now hold "alt" again and press 032, this will remove the small character, however telegram will still think there is a valid character there and allows you to press "send" to send a blank message

chris
  • 1