如何在电报机器人中发送空消息? [英] How to send empty message in telegram bot?

查看:117
本文介绍了如何在电报机器人中发送空消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的电报机器人中有这个键盘:

I have this keyboard in my telegram bot:

当我点击右箭头时,我得到了这个新键盘:

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

代码是这样的:

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

我知道在 sendmessage 方法中需要文本,但我正在寻找发送空消息的方法或解决方法.

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

我尝试过使用空格或类似的 html 实体,但没有成功.

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

有没有办法做到这一点?

There is a way to do this?

谢谢.

推荐答案

我认为没有办法做你想做的事.

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

考虑一下:

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".

这篇关于如何在电报机器人中发送空消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆