You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: include/tgbot/types/ForceReply.h
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
#defineTGBOT_FORCEREPLY_H
3
3
4
4
#include"tgbot/types/GenericReply.h"
5
+
#include"tgbot/Optional.h"
5
6
6
7
#include<memory>
7
8
#include<string>
@@ -35,14 +36,14 @@ class ForceReply : public GenericReply {
35
36
/**
36
37
* @brief Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
37
38
*/
38
-
std::string inputFieldPlaceholder;
39
+
Optional<std::string> inputFieldPlaceholder;
39
40
40
41
/**
41
42
* @brief Optional. Use this parameter if you want to force reply from specific users only.
42
43
*
43
44
* Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
* @brief Optional. HTTP or tg:// URL to be opened when the button is pressed.
33
34
*
34
35
* Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
35
36
*/
36
-
std::string url;
37
+
Optional<std::string> url;
37
38
38
39
/**
39
40
* @brief Optional. Data to be sent in a [callback query](https://core.telegram.org/bots/api#callbackquery) to the bot when button is pressed, 1-64 bytes
40
41
*/
41
-
std::string callbackData;
42
+
Optional<std::string> callbackData;
42
43
43
44
/**
44
45
* @brief Optional. Description of the [Web App](https://core.telegram.org/bots/webapps) that will be launched when the user presses the button.
45
46
*
46
47
* The Web App will be able to send an arbitrary message on behalf of the user using the method Api::answerWebAppQuery.
47
48
* Available only in private chats between a user and the bot.
48
49
*/
49
-
WebAppInfo::Ptr webApp;
50
+
OptionalPtr<WebAppInfo::Ptr> webApp;
50
51
51
52
/**
52
53
* @brief Optional. An HTTPS URL used to automatically authorize the user.
53
54
*
54
55
* Can be used as a replacement for the [Telegram Login Widget](https://core.telegram.org/widgets/login).
55
56
*/
56
-
LoginUrl::Ptr loginUrl;
57
+
OptionalPtr<LoginUrl::Ptr> loginUrl;
57
58
58
59
/**
59
60
* @brief Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field.
60
61
*
61
62
* May be empty, in which case just the bot's username will be inserted.
62
63
*/
63
-
std::string switchInlineQuery;
64
+
Optional<std::string> switchInlineQuery;
64
65
65
66
/**
66
67
* @brief Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field.
67
68
*
68
69
* May be empty, in which case only the bot's username will be inserted.
69
70
* This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
* @brief Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field
Copy file name to clipboardExpand all lines: include/tgbot/types/LinkPreviewOptions.h
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
#ifndef TGBOT_LINKPREVIEWOPTIONS_H
2
2
#defineTGBOT_LINKPREVIEWOPTIONS_H
3
3
4
+
#include"tgbot/Optional.h"
5
+
4
6
#include<memory>
5
7
#include<string>
6
-
#include<boost/optional.hpp>
7
8
8
9
namespaceTgBot {
9
10
@@ -20,29 +21,29 @@ class LinkPreviewOptions {
20
21
/**
21
22
* @brief Optional. True, if the link preview is disabled
22
23
*/
23
-
boost::optional<bool> isDisabled;
24
+
Optional<bool> isDisabled;
24
25
25
26
/**
26
27
* @brief Optional. URL to use for the link preview.
27
28
*
28
29
* If empty, then the first URL found in the message text will be used
29
30
*/
30
-
boost::optional<std::string> url;
31
+
Optional<std::string> url;
31
32
32
33
/**
33
34
* @brief Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
34
35
*/
35
-
boost::optional<bool> preferSmallMedia;
36
+
Optional<bool> preferSmallMedia;
36
37
37
38
/**
38
39
* @brief Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
39
40
*/
40
-
boost::optional<bool> preferLargeMedia;
41
+
Optional<bool> preferLargeMedia;
41
42
42
43
/**
43
44
* @brief Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
Copy file name to clipboardExpand all lines: include/tgbot/types/LoginUrl.h
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
#ifndef TGBOT_LOGINURL_H
2
2
#defineTGBOT_LOGINURL_H
3
3
4
+
#include"tgbot/Optional.h"
5
+
4
6
#include<memory>
5
7
#include<string>
6
8
@@ -27,12 +29,12 @@ class LoginUrl {
27
29
*
28
30
* NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in https://core.telegram.org/widgets/login#checking-authorization
29
31
*/
30
-
std::string url;
32
+
Required<std::string> url;
31
33
32
34
/**
33
35
* @brief Optional. New text of the button in forwarded messages.
34
36
*/
35
-
std::string forwardText;
37
+
Optional<std::string> forwardText;
36
38
37
39
/**
38
40
* @brief Optional. Username of a bot, which will be used for user authorization.
@@ -41,12 +43,12 @@ class LoginUrl {
41
43
* The url's domain must be the same as the domain linked with the bot.
42
44
* See https://core.telegram.org/widgets/login#linking-your-domain-to-the-bot for more details.
43
45
*/
44
-
std::string botUsername;
46
+
Optional<std::string> botUsername;
45
47
46
48
/**
47
49
* @brief Optional. Pass True to request the permission for your bot to send messages to the user.
* @brief Optional. Requests clients to always show the keyboard when the regular keyboard is hidden.
30
31
*
31
32
* Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
32
33
*/
33
-
bool isPersistent;
34
+
Optional<bool> isPersistent;
34
35
35
36
/**
36
37
* @brief Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons).
37
38
*
38
39
* Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
39
40
*/
40
-
bool resizeKeyboard;
41
+
Optional<bool> resizeKeyboard;
41
42
42
43
/**
43
44
* @brief Optional. Requests clients to hide the keyboard as soon as it's been used.
44
45
*
45
46
* The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again.
46
47
* Defaults to false.
47
48
*/
48
-
bool oneTimeKeyboard;
49
+
Optional<bool> oneTimeKeyboard;
49
50
50
51
/**
51
52
* @brief Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
52
53
*/
53
-
std::string inputFieldPlaceholder;
54
+
Optional<std::string> inputFieldPlaceholder;
54
55
55
56
/**
56
57
* @brief Optional. Use this parameter if you want to show the keyboard to specific users only.
@@ -59,7 +60,7 @@ class ReplyKeyboardMarkup : public GenericReply {
59
60
* Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language.
60
61
* Other users in the group don't see the keyboard.
Copy file name to clipboardExpand all lines: include/tgbot/types/ReplyKeyboardRemove.h
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
#ifndef TGBOT_REPLYKEYBOARDREMOVE_H
2
2
#defineTGBOT_REPLYKEYBOARDREMOVE_H
3
3
4
+
#include"tgbot/Optional.h"
4
5
#include"tgbot/types/GenericReply.h"
5
6
6
7
#include<memory>
@@ -23,15 +24,15 @@ class ReplyKeyboardRemove : public GenericReply {
23
24
/**
24
25
* @brief Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use oneTimeKeyboard in ReplyKeyboardMarkup)
25
26
*/
26
-
bool removeKeyboard;
27
+
Required<bool> removeKeyboard;
27
28
28
29
/**
29
30
* @brief Optional. Use this parameter if you want to remove the keyboard for specific users only.
30
31
*
31
32
* Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply to a message in the same chat and forum topic, sender of the original message.
32
33
* Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
0 commit comments