1 #ifndef TGBOT_METHODS_API_H 2 #define TGBOT_METHODS_API_H 24 const std::string &chatId,
const std::string &text,
26 const bool &disableWebPagePreview =
false,
27 const bool &disableNotification =
false,
31 const std::string &chatId,
const std::string &text,
32 const int &replyToMessageId,
34 const bool &disableWebPagePreview =
false,
35 const bool &disableNotification =
false,
39 const std::string &chatId,
const std::string &fromChatId,
40 const int &messageId,
const bool &disableNotification =
false)
const;
43 const std::string &chatId,
const std::string &photo,
45 const std::string &mimeType =
"",
const std::string &caption =
"",
46 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
50 const std::string &chatId,
const std::string &audio,
52 const std::string &mimeType =
"",
const std::string &caption =
"",
53 const int &duration = -1,
const std::string &performer =
"",
54 const std::string &title =
"",
const bool &disableNotification =
false,
55 const int &replyToMessageId = -1,
59 const std::string &chatId,
const std::string &document,
61 const std::string &mimeType =
"",
const std::string &caption =
"",
62 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
66 const std::string &chatId,
const std::string &video,
68 const std::string &mimeType =
"",
const int &duration = -1,
69 const int &width = -1,
const int &height = -1,
70 const std::string &caption =
"",
const bool &supportsStreaming =
false,
71 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
75 const std::string &chatId,
const std::string &voice,
77 const std::string &caption =
"",
const int &duration = -1,
78 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
82 const std::string &chatId,
const std::string &videoNote,
84 const std::string &caption =
"",
const int &duration = -1,
85 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
89 const std::string &chatId,
const double &latitude,
90 const double &longitude,
const int &liveLocation = -1,
91 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
95 const std::string &chatId,
const double &latitude,
96 const double &longitude,
const std::string &title,
97 const std::string &address,
const std::string& foursquareType =
"",
98 const std::string &foursquareId =
"",
99 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
103 const std::string &chatId,
const std::string &phoneNumber,
104 const std::string &firstName,
const std::string &vCard =
"",
105 const std::string &lastName =
"",
106 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
110 const std::string &chatId,
const std::string &sticker,
112 const bool &disableNotification =
false,
const int &replyToMessageId = -1,
120 const bool &disableNotification =
false,
121 const int &replyToMessageId = -1)
const;
129 const bool &disableNotification =
false,
130 const int &replyToMessageId = -1)
const;
132 std::vector<api_types::Message> sendMediaGroup(
133 const std::string &chatId,
134 const std::vector<tgbot::types::Ptr<types::InputMedia>> &media,
135 const bool &disableNotification =
false,
136 const int &replyToMessageId = -1)
const;
139 const std::string &gameShortName,
140 const bool &disableNotification =
false,
141 const int &replyToMessageId = -1,
145 const std::string& question,
146 const std::vector<std::string>& options,
147 const bool &disableNotification =
false,
148 const int &replyToMessageId = -1,
152 const int& messageId,
156 const std::string &inlineMessageId,
157 const bool &force =
false,
158 const bool &disableEditMessage =
false)
const;
161 const int &chatId,
const int &messageId,
162 const bool &force =
false,
163 const bool &disableEditMessage =
false)
const;
165 std::vector<api_types::GameHighScore> getGameHighScores(
166 const int &userId,
const std::string &inlineMessageId)
const;
168 std::vector<api_types::GameHighScore> getGameHighScores(
169 const int &userId,
const int &chatId,
const int &messageId)
const;
175 const std::string &errorMessage)
const;
181 const std::string &shippingQueryId,
182 const std::vector<types::ShippingOption> &shippingOptions)
const;
188 const std::string &errorMessage)
const;
198 const int &userId,
const std::string &pngSticker,
201 bool createNewStickerSet(
202 const int &userId,
const std::string &name,
const std::string &title,
203 const std::string &emoji,
const std::string &pngSticker,
206 bool createNewStickerSet(
207 const int &userId,
const std::string &name,
const std::string &title,
208 const std::string &emoji,
const std::string &pngSticker,
212 bool addStickerToSet(
213 const int &userId,
const std::string &name,
const std::string &emoji,
214 const std::string &pngSticker,
217 bool addStickerToSet(
218 const int &userId,
const std::string &name,
const std::string &emoji,
219 const std::string &pngSticker,
223 bool setStickerPositionInSet(
const std::string &sticker,
224 const int &position)
const;
226 bool deleteStickerFromSet(
const std::string &sticker)
const;
228 bool sendChatAction(
const std::string &chatId,
231 bool kickChatMember(
const std::string &chatId,
const int &userId,
232 const int &untilDate = -1)
const;
234 bool unbanChatMember(
const std::string &chatId,
const int &userId)
const;
236 bool restrictChatMember(
const std::string &chatId,
const int &userId,
238 const int &untilDate = -1)
const;
240 bool promoteChatMember(
const std::string &chatId,
const int &userId,
243 std::string exportChatInviteLink(
const std::string &chatId)
const;
245 bool setChatPhoto(
const std::string &chatId,
const std::string &filename,
246 const std::string &mimeType)
const;
248 bool deleteChatPhoto(
const std::string &chatId)
const;
250 bool setChatTitle(
const std::string &chatId,
const std::string &title)
const;
252 bool setChatDescription(
const std::string &chatId,
253 const std::string &description)
const;
255 bool pinChatMessage(
const std::string &chatId,
const std::string &messageId,
256 const bool &disableNotification =
false)
const;
258 bool unpinChatMessage(
const std::string &chatId)
const;
260 bool leaveChat(
const std::string &chatId)
const;
262 bool answerCallbackQuery(
const std::string &callbackQueryId,
263 const std::string &text =
"",
264 const bool &showAlert =
false,
265 const std::string &url =
"",
266 const int &cacheTime = 0)
const;
268 bool answerInlineQuery(
269 const std::string &inlineQueryId,
270 const std::vector<::tgbot::types::Ptr<types::InlineQueryResult>> &results,
271 const int &cacheTime = 0,
const bool &isPersonal =
true,
272 const std::string &nextOffset =
"",
const std::string &switchPmText =
"",
273 const std::string &switchPmParameter =
"")
const;
276 const std::string &inlineMessageId,
const std::string &text,
278 const bool &disableWebPagePreview =
false)
const;
281 const std::string &inlineMessageId,
284 const bool &disableWebPagePreview =
false)
const;
287 const std::string &chatId,
const std::string &messageId,
288 const std::string &text,
290 const bool &disableWebPagePreview =
false)
const;
293 const std::string &chatId,
const std::string &messageId,
296 const bool &disableWebPagePreview =
false)
const;
299 const std::string &inlineMessageId,
303 const std::string &chatId,
const std::string &messageId,
307 const std::string &messageId,
308 const std::string &caption)
const;
311 const std::string &caption)
const;
314 const std::string &chatId,
const std::string &messageId,
316 const std::string &caption)
const;
319 const std::string &inlineMessageId,
321 const std::string &caption)
const;
324 const double &longitude,
const double &latitude,
const int &chatId,
328 const double &longitude,
const double &latitude,
329 const std::string &inlineMessageId,
333 const std::string &inlineMessageId,
339 const std::string &chatId,
340 const int &messageId,
346 const int &chatId,
const int &messageId,
350 const std::string &inlineMessageId,
353 bool setChatStickerSet(
const int &chatId,
354 const std::string &stickerSetName)
const;
356 bool setChatStickerSet(
const std::string &chatId,
357 const std::string &stickerSetName)
const;
359 bool deleteChatStickerSet(
const int &chatId)
const;
361 bool deleteChatStickerSet(
const std::string &chatId)
const;
363 bool deleteMessage(
const std::string &chatId,
364 const std::string &messageId)
const;
372 std::vector<api_types::ChatMember> getChatAdministrators(
373 const std::string &chatId)
const;
375 unsigned getChatMembersCount(
const std::string &chatId)
const;
378 const int &userId)
const;
381 const int &userId,
const unsigned &offset = 0,
382 const unsigned &limit = 100)
const;
384 bool deleteWebhook()
const;
389 const std::string &url,
const int &maxConnections = 40,
390 const std::vector<api_types::UpdateType> &allowedUpdates = {});
393 const std::string &url,
const std::string &certificate,
394 const int &maxConnections = 40,
395 const std::vector<api_types::UpdateType> &allowedUpdates = {});
397 inline Logger const &getLogger()
const {
return logger; }
399 inline Logger &getLogger() {
return logger; }
402 explicit Api(
const std::string &token);
404 Api(
const std::string &token,
405 const std::vector<api_types::UpdateType> &allowedUpdates,
406 const int &timeout,
const int &limit);
408 Api(
const std::string &token,
const std::string &url,
409 const int &maxConnections,
410 const std::vector<api_types::UpdateType> &allowedUpdates);
412 Api(
const std::string &token,
const std::string &url,
413 const std::string &certificate,
const int &maxConnections,
414 const std::vector<api_types::UpdateType> &allowedUpdates);
416 int getUpdates(
void *c, std::vector<api_types::Update> &updates);
418 std::string urlWebhook{
""};
421 std::string baseApi{
""};
422 std::string updateApiRequest{
""};
423 int currentOffset{0};
bool answerPreCheckoutQuery(const std::string &preCheckoutQueryId, const std::string &errorMessage) const
Use this overload if the checkout phase can take place.
API-interacting types.
Definition: types.h:16
This struct contains parameters for sendInvoice method.
Definition: types.h:543
FileSource
Choose if filename should be treated as file_id or uploaded via multipart.
Definition: types.h:70
ChatAction
What the bot is doing.
Definition: types.h:53
Main tgbot namespace.
Definition: bot.h:13
ParseMode
Parsing mode to be used.
Definition: types.h:46
Logging facility for telegram-bot-api, see also: tgbot::methods::Api::getLogger() ...
Definition: logger.h:12
bool answerShippingQuery(const std::string &shippingQueryId, const std::string &errorMessage) const
Use this overload if the shipping query cannot proceed.
Contains Telegram bot API methods.
Definition: api.h:19
api_types::Message sendInvoice(const int &chatId, const types::Invoice &invoice, const bool &disableNotification=false, const int &replyToMessageId=-1) const
Please refer to tgbot::methods::types::Invoice struct.