调整 Telegram 内联键盘的大小 [英] resizing Telegram inline keyboard

查看:107
本文介绍了调整 Telegram 内联键盘的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Telegram 的内嵌键盘 是一个很棒的功能有许多不同的用例.

Telegram's inline keyboard is a great feature with lots of different use cases.

内联按钮作为项目列表添加,如下所示:

Inline buttons are added as a list of items like this:

inline_keyboard = [[InlineKeyboardButton(text="button", callback_data="button"),
                  InlineKeyboardButton(text="reset",callback_data="reset")]]

inline_keyboard_markup = InlineKeyboardMarkup(inline_keyboard)
update.message.reply_text("hi", reply_markup=inline_keyboard_markup)

上面的代码添加了两个按钮,每个按钮的宽度为聊天屏幕的一半.

The above code adds two buttons each with the half width of the chat screen.

我知道对于普通的键盘按钮,有一个 resize_keyboard 参数可以以某种方式使用.

I know that for the the normal keyboard button there is a resize_keyboard parameter which somehow can be used.

我的问题是有没有办法调整内嵌按钮的大小?例如使其全宽或四分之一宽.

My question is that is there a way to resize the inline buttons? for example to make it full width or quarter width.

推荐答案

很遗憾,您暂时无法执行此操作.:(

Unfortunately, you can't do it for now. :(

您可以向 @BotSupport 提出建议,他们可能会将此功能添加到下一个版本.

You can suggest this to @BotSupport, they might add this feature to next version.

这篇关于调整 Telegram 内联键盘的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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