Class KeyboardButtonRequestChat
java.lang.Object
io.github.natanimn.telebof.types.keyboard.KeyboardButtonRequestChat
- All Implemented Interfaces:
Serializable
This object defines the criteria used to request a suitable chat.
Information about the selected chat will be shared with the bot when the corresponding button is pressed.
The bot will be granted requested rights in the chat if appropriate.
- Since:
- 3 March 2025, More about requesting chats ยป.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbotAdministratorRights
(ChatAdministratorRights bot_administrator_rights) OptionalbotIsMember
(boolean bot_is_member) OptionalchatHasUsername
(boolean chat_has_username) OptionalchatIsCreated
(boolean chat_is_created) OptionalchatIsForum
(boolean chat_is_forum) OptionalrequestPhoto
(boolean request_photo) OptionalrequestTitle
(boolean request_title) OptionalrequestUsername
(boolean request_username) OptionaluserAdministratorRights
(ChatAdministratorRights user_administrator_rights) Optional
-
Constructor Details
-
KeyboardButtonRequestChat
public KeyboardButtonRequestChat(int request_id, boolean chat_is_channel) Required- Parameters:
request_id
- Signed 32-bit identifier of the request, which will be received back in theChatShared
object. Must be unique within the messagechat_is_channel
- Pass True to request a channel chat, pass False to request a group or a supergroup chat.
-
-
Method Details
-
chatIsForum
Optional- Parameters:
chat_is_forum
- Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
chatHasUsername
Optional- Parameters:
chat_has_username
- Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
chatIsCreated
Optional- Parameters:
chat_is_created
- Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
userAdministratorRights
public KeyboardButtonRequestChat userAdministratorRights(ChatAdministratorRights user_administrator_rights) Optional- Parameters:
user_administrator_rights
- A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
botAdministratorRights
public KeyboardButtonRequestChat botAdministratorRights(ChatAdministratorRights bot_administrator_rights) Optional- Parameters:
bot_administrator_rights
- A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset ofuserAdministratorRights(ChatAdministratorRights)
. If not specified, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
botIsMember
Optional- Parameters:
bot_is_member
- Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.- Returns:
KeyboardButtonRequestChat
-
requestTitle
Optional- Parameters:
request_title
- Pass True to request the chat's title- Returns:
KeyboardButtonRequestChat
-
requestUsername
Optional- Parameters:
request_username
- Pass True to request the chat's username- Returns:
KeyboardButtonRequestChat
-
requestPhoto
Optional- Parameters:
request_photo
- Pass True to request the chat's photo- Returns:
KeyboardButtonRequestChat
-