teleswagger 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +69 -0
- data/README.md +260 -0
- data/Rakefile +8 -0
- data/config.json +5 -0
- data/docs/AddStickerToSetLinkBody.md +12 -0
- data/docs/AllowedUpdate.md +7 -0
- data/docs/Animation.md +12 -0
- data/docs/AnswerInlineQueryBody.md +14 -0
- data/docs/AnswerShippingQueryBody.md +11 -0
- data/docs/AttachmentsApi.md +1023 -0
- data/docs/Audio.md +13 -0
- data/docs/CallbackGame.md +7 -0
- data/docs/CallbackQuery.md +14 -0
- data/docs/CallbacksApi.md +70 -0
- data/docs/Chat.md +18 -0
- data/docs/ChatMember.md +23 -0
- data/docs/ChatPhoto.md +9 -0
- data/docs/ChatsApi.md +890 -0
- data/docs/ChosenInlineResult.md +12 -0
- data/docs/Contact.md +11 -0
- data/docs/CreateNewStickerSetLinkBody.md +14 -0
- data/docs/Document.md +12 -0
- data/docs/EditMessageCaptionBody.md +12 -0
- data/docs/EditMessageReplyMarkupBody.md +11 -0
- data/docs/EditMessageTextBody.md +14 -0
- data/docs/Error.md +10 -0
- data/docs/File.md +10 -0
- data/docs/ForceReply.md +9 -0
- data/docs/Game.md +13 -0
- data/docs/GameHighScore.md +10 -0
- data/docs/GamesApi.md +182 -0
- data/docs/InlineApi.md +59 -0
- data/docs/InlineKeyboardButton.md +14 -0
- data/docs/InlineKeyboardMarkup.md +8 -0
- data/docs/InlineQuery.md +12 -0
- data/docs/InlineQueryResultArticle.md +18 -0
- data/docs/InlineQueryResultAudio.md +16 -0
- data/docs/InlineQueryResultCachedAudio.md +13 -0
- data/docs/InlineQueryResultCachedDocument.md +14 -0
- data/docs/InlineQueryResultCachedGif.md +14 -0
- data/docs/InlineQueryResultCachedMpeg4Gif.md +14 -0
- data/docs/InlineQueryResultCachedPhoto.md +15 -0
- data/docs/InlineQueryResultCachedSticker.md +12 -0
- data/docs/InlineQueryResultCachedVideo.md +15 -0
- data/docs/InlineQueryResultCachedVoice.md +14 -0
- data/docs/InlineQueryResultContact.md +17 -0
- data/docs/InlineQueryResultDocument.md +19 -0
- data/docs/InlineQueryResultGame.md +11 -0
- data/docs/InlineQueryResultGif.md +18 -0
- data/docs/InlineQueryResultLocation.md +17 -0
- data/docs/InlineQueryResultMpeg4Gif.md +18 -0
- data/docs/InlineQueryResultPhoto.md +17 -0
- data/docs/InlineQueryResultVenue.md +19 -0
- data/docs/InlineQueryResultVideo.md +20 -0
- data/docs/InlineQueryResultVoice.md +15 -0
- data/docs/InlineResponse200.md +11 -0
- data/docs/InlineResponse2001.md +11 -0
- data/docs/InlineResponse2002.md +11 -0
- data/docs/InlineResponse2003.md +11 -0
- data/docs/InlineResponse2004.md +11 -0
- data/docs/InlineResponse2005.md +11 -0
- data/docs/InlineResponse2006.md +11 -0
- data/docs/InlineResponse2007.md +11 -0
- data/docs/InlineResponse2008.md +11 -0
- data/docs/InlineResponse2009.md +11 -0
- data/docs/InlineType.md +7 -0
- data/docs/InputContactMessageContent.md +10 -0
- data/docs/InputLocationMessageContent.md +9 -0
- data/docs/InputTextMessageContent.md +10 -0
- data/docs/InputVenueMessageContent.md +12 -0
- data/docs/Invoice.md +12 -0
- data/docs/KeyboardButton.md +10 -0
- data/docs/LabeledPrice.md +9 -0
- data/docs/Location.md +9 -0
- data/docs/MaskPosition.md +11 -0
- data/docs/Message.md +45 -0
- data/docs/MessageEntity.md +12 -0
- data/docs/MessagesApi.md +375 -0
- data/docs/OrderInfo.md +11 -0
- data/docs/ParseMode.md +7 -0
- data/docs/PaymentsApi.md +167 -0
- data/docs/PhotoSize.md +11 -0
- data/docs/PreCheckoutQuery.md +14 -0
- data/docs/PromoteChatMemberBody.md +17 -0
- data/docs/ReplyKeyboardMarkup.md +11 -0
- data/docs/ReplyKeyboardRemove.md +9 -0
- data/docs/ResponseBool.md +11 -0
- data/docs/ResponseMessage.md +11 -0
- data/docs/ResponseParameters.md +9 -0
- data/docs/ResponseUpdate.md +11 -0
- data/docs/RestrictChatMemberBody.md +14 -0
- data/docs/SendAudioLinkBody.md +16 -0
- data/docs/SendContactBody.md +14 -0
- data/docs/SendDocumentLinkBody.md +13 -0
- data/docs/SendGameBody.md +12 -0
- data/docs/SendInvoiceBody.md +27 -0
- data/docs/SendLocationBody.md +13 -0
- data/docs/SendMessageBody.md +14 -0
- data/docs/SendPhotoLinkBody.md +13 -0
- data/docs/SendStickerLinkBody.md +12 -0
- data/docs/SendVenueBody.md +16 -0
- data/docs/SendVideoLinkBody.md +16 -0
- data/docs/SendVideoNoteLinkBody.md +14 -0
- data/docs/SendVoiceLinkBody.md +14 -0
- data/docs/ShippingAddress.md +13 -0
- data/docs/ShippingOption.md +10 -0
- data/docs/ShippingQuery.md +11 -0
- data/docs/Sticker.md +15 -0
- data/docs/StickerSet.md +11 -0
- data/docs/StickersApi.md +498 -0
- data/docs/SuccessfulPayment.md +14 -0
- data/docs/Update.md +17 -0
- data/docs/UpdatesApi.md +205 -0
- data/docs/User.md +13 -0
- data/docs/UserProfilePhotos.md +9 -0
- data/docs/UsersApi.md +111 -0
- data/docs/Venue.md +11 -0
- data/docs/Video.md +14 -0
- data/docs/VideoNote.md +12 -0
- data/docs/Voice.md +11 -0
- data/docs/WebhookInfo.md +14 -0
- data/lib/teleswagger.rb +156 -0
- data/lib/teleswagger/api/attachments_api.rb +1243 -0
- data/lib/teleswagger/api/callbacks_api.rb +113 -0
- data/lib/teleswagger/api/chats_api.rb +1141 -0
- data/lib/teleswagger/api/games_api.rb +235 -0
- data/lib/teleswagger/api/inline_api.rb +80 -0
- data/lib/teleswagger/api/messages_api.rb +460 -0
- data/lib/teleswagger/api/payments_api.rb +209 -0
- data/lib/teleswagger/api/stickers_api.rb +658 -0
- data/lib/teleswagger/api/updates_api.rb +265 -0
- data/lib/teleswagger/api/users_api.rb +146 -0
- data/lib/teleswagger/api_client.rb +388 -0
- data/lib/teleswagger/api_error.rb +38 -0
- data/lib/teleswagger/configuration.rb +202 -0
- data/lib/teleswagger/models/add_sticker_to_set_link_body.rb +244 -0
- data/lib/teleswagger/models/allowed_update.rb +27 -0
- data/lib/teleswagger/models/animation.rb +229 -0
- data/lib/teleswagger/models/answer_inline_query_body.rb +254 -0
- data/lib/teleswagger/models/answer_shipping_query_body.rb +227 -0
- data/lib/teleswagger/models/audio.rb +233 -0
- data/lib/teleswagger/models/callback_game.rb +179 -0
- data/lib/teleswagger/models/callback_query.rb +242 -0
- data/lib/teleswagger/models/chat.rb +321 -0
- data/lib/teleswagger/models/chat_member.rb +366 -0
- data/lib/teleswagger/models/chat_photo.rb +197 -0
- data/lib/teleswagger/models/chosen_inline_result.rb +239 -0
- data/lib/teleswagger/models/contact.rb +215 -0
- data/lib/teleswagger/models/create_new_sticker_set_link_body.rb +267 -0
- data/lib/teleswagger/models/document.rb +224 -0
- data/lib/teleswagger/models/edit_message_caption_body.rb +224 -0
- data/lib/teleswagger/models/edit_message_reply_markup_body.rb +215 -0
- data/lib/teleswagger/models/edit_message_text_body.rb +247 -0
- data/lib/teleswagger/models/error.rb +206 -0
- data/lib/teleswagger/models/file.rb +206 -0
- data/lib/teleswagger/models/force_reply.rb +197 -0
- data/lib/teleswagger/models/game.rb +252 -0
- data/lib/teleswagger/models/game_high_score.rb +206 -0
- data/lib/teleswagger/models/inline_keyboard_button.rb +242 -0
- data/lib/teleswagger/models/inline_keyboard_markup.rb +190 -0
- data/lib/teleswagger/models/inline_query.rb +224 -0
- data/lib/teleswagger/models/inline_query_result_article.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_audio.rb +280 -0
- data/lib/teleswagger/models/inline_query_result_cached_audio.rb +248 -0
- data/lib/teleswagger/models/inline_query_result_cached_document.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_gif.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_mpeg4_gif.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_cached_photo.rb +266 -0
- data/lib/teleswagger/models/inline_query_result_cached_sticker.rb +239 -0
- data/lib/teleswagger/models/inline_query_result_cached_video.rb +266 -0
- data/lib/teleswagger/models/inline_query_result_cached_voice.rb +257 -0
- data/lib/teleswagger/models/inline_query_result_contact.rb +289 -0
- data/lib/teleswagger/models/inline_query_result_document.rb +312 -0
- data/lib/teleswagger/models/inline_query_result_game.rb +230 -0
- data/lib/teleswagger/models/inline_query_result_gif.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_location.rb +294 -0
- data/lib/teleswagger/models/inline_query_result_mpeg4_gif.rb +298 -0
- data/lib/teleswagger/models/inline_query_result_photo.rb +289 -0
- data/lib/teleswagger/models/inline_query_result_venue.rb +317 -0
- data/lib/teleswagger/models/inline_query_result_video.rb +326 -0
- data/lib/teleswagger/models/inline_query_result_voice.rb +271 -0
- data/lib/teleswagger/models/inline_response_200.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_1.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_2.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_3.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_4.rb +217 -0
- data/lib/teleswagger/models/inline_response_200_5.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_6.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_7.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_8.rb +215 -0
- data/lib/teleswagger/models/inline_response_200_9.rb +215 -0
- data/lib/teleswagger/models/inline_type.rb +33 -0
- data/lib/teleswagger/models/input_contact_message_content.rb +216 -0
- data/lib/teleswagger/models/input_location_message_content.rb +207 -0
- data/lib/teleswagger/models/input_text_message_content.rb +211 -0
- data/lib/teleswagger/models/input_venue_message_content.rb +244 -0
- data/lib/teleswagger/models/invoice.rb +224 -0
- data/lib/teleswagger/models/keyboard_button.rb +206 -0
- data/lib/teleswagger/models/labeled_price.rb +197 -0
- data/lib/teleswagger/models/location.rb +197 -0
- data/lib/teleswagger/models/mask_position.rb +248 -0
- data/lib/teleswagger/models/message.rb +529 -0
- data/lib/teleswagger/models/message_entity.rb +257 -0
- data/lib/teleswagger/models/order_info.rb +215 -0
- data/lib/teleswagger/models/parse_mode.rb +22 -0
- data/lib/teleswagger/models/photo_size.rb +215 -0
- data/lib/teleswagger/models/pre_checkout_query.rb +242 -0
- data/lib/teleswagger/models/promote_chat_member_body.rb +279 -0
- data/lib/teleswagger/models/reply_keyboard_markup.rb +217 -0
- data/lib/teleswagger/models/reply_keyboard_remove.rb +197 -0
- data/lib/teleswagger/models/response_bool.rb +215 -0
- data/lib/teleswagger/models/response_message.rb +215 -0
- data/lib/teleswagger/models/response_parameters.rb +197 -0
- data/lib/teleswagger/models/response_update.rb +217 -0
- data/lib/teleswagger/models/restrict_chat_member_body.rb +252 -0
- data/lib/teleswagger/models/send_audio_link_body.rb +270 -0
- data/lib/teleswagger/models/send_contact_body.rb +257 -0
- data/lib/teleswagger/models/send_document_link_body.rb +243 -0
- data/lib/teleswagger/models/send_game_body.rb +234 -0
- data/lib/teleswagger/models/send_invoice_body.rb +401 -0
- data/lib/teleswagger/models/send_location_body.rb +248 -0
- data/lib/teleswagger/models/send_message_body.rb +252 -0
- data/lib/teleswagger/models/send_photo_link_body.rb +243 -0
- data/lib/teleswagger/models/send_sticker_link_body.rb +234 -0
- data/lib/teleswagger/models/send_venue_body.rb +285 -0
- data/lib/teleswagger/models/send_video_link_body.rb +270 -0
- data/lib/teleswagger/models/send_video_note_link_body.rb +252 -0
- data/lib/teleswagger/models/send_voice_link_body.rb +252 -0
- data/lib/teleswagger/models/shipping_address.rb +233 -0
- data/lib/teleswagger/models/shipping_option.rb +208 -0
- data/lib/teleswagger/models/shipping_query.rb +215 -0
- data/lib/teleswagger/models/sticker.rb +251 -0
- data/lib/teleswagger/models/sticker_set.rb +217 -0
- data/lib/teleswagger/models/successful_payment.rb +242 -0
- data/lib/teleswagger/models/update.rb +269 -0
- data/lib/teleswagger/models/user.rb +233 -0
- data/lib/teleswagger/models/user_profile_photos.rb +199 -0
- data/lib/teleswagger/models/venue.rb +215 -0
- data/lib/teleswagger/models/video.rb +242 -0
- data/lib/teleswagger/models/video_note.rb +224 -0
- data/lib/teleswagger/models/voice.rb +215 -0
- data/lib/teleswagger/models/webhook_info.rb +259 -0
- data/lib/teleswagger/version.rb +15 -0
- data/spec/api/attachments_api_spec.rb +311 -0
- data/spec/api/callbacks_api_spec.rb +52 -0
- data/spec/api/chats_api_spec.rb +266 -0
- data/spec/api/games_api_spec.rb +83 -0
- data/spec/api/inline_api_spec.rb +48 -0
- data/spec/api/messages_api_spec.rb +130 -0
- data/spec/api/payments_api_spec.rb +76 -0
- data/spec/api/stickers_api_spec.rb +165 -0
- data/spec/api/updates_api_spec.rb +89 -0
- data/spec/api/users_api_spec.rb +62 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/add_sticker_to_set_link_body_spec.rb +66 -0
- data/spec/models/allowed_update_spec.rb +36 -0
- data/spec/models/animation_spec.rb +66 -0
- data/spec/models/answer_inline_query_body_spec.rb +78 -0
- data/spec/models/answer_shipping_query_body_spec.rb +60 -0
- data/spec/models/audio_spec.rb +72 -0
- data/spec/models/callback_game_spec.rb +36 -0
- data/spec/models/callback_query_spec.rb +78 -0
- data/spec/models/chat_member_spec.rb +136 -0
- data/spec/models/chat_photo_spec.rb +48 -0
- data/spec/models/chat_spec.rb +106 -0
- data/spec/models/chosen_inline_result_spec.rb +66 -0
- data/spec/models/contact_spec.rb +60 -0
- data/spec/models/create_new_sticker_set_link_body_spec.rb +78 -0
- data/spec/models/document_spec.rb +66 -0
- data/spec/models/edit_message_caption_body_spec.rb +66 -0
- data/spec/models/edit_message_reply_markup_body_spec.rb +60 -0
- data/spec/models/edit_message_text_body_spec.rb +78 -0
- data/spec/models/error_spec.rb +54 -0
- data/spec/models/file_spec.rb +54 -0
- data/spec/models/force_reply_spec.rb +48 -0
- data/spec/models/game_high_score_spec.rb +54 -0
- data/spec/models/game_spec.rb +72 -0
- data/spec/models/inline_keyboard_button_spec.rb +78 -0
- data/spec/models/inline_keyboard_markup_spec.rb +42 -0
- data/spec/models/inline_query_result_article_spec.rb +102 -0
- data/spec/models/inline_query_result_audio_spec.rb +90 -0
- data/spec/models/inline_query_result_cached_audio_spec.rb +72 -0
- data/spec/models/inline_query_result_cached_document_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_gif_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_mpeg4_gif_spec.rb +78 -0
- data/spec/models/inline_query_result_cached_photo_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_sticker_spec.rb +66 -0
- data/spec/models/inline_query_result_cached_video_spec.rb +84 -0
- data/spec/models/inline_query_result_cached_voice_spec.rb +78 -0
- data/spec/models/inline_query_result_contact_spec.rb +96 -0
- data/spec/models/inline_query_result_document_spec.rb +108 -0
- data/spec/models/inline_query_result_game_spec.rb +60 -0
- data/spec/models/inline_query_result_gif_spec.rb +102 -0
- data/spec/models/inline_query_result_location_spec.rb +96 -0
- data/spec/models/inline_query_result_mpeg4_gif_spec.rb +102 -0
- data/spec/models/inline_query_result_photo_spec.rb +96 -0
- data/spec/models/inline_query_result_venue_spec.rb +108 -0
- data/spec/models/inline_query_result_video_spec.rb +114 -0
- data/spec/models/inline_query_result_voice_spec.rb +84 -0
- data/spec/models/inline_query_spec.rb +66 -0
- data/spec/models/inline_response_200_1_spec.rb +60 -0
- data/spec/models/inline_response_200_2_spec.rb +60 -0
- data/spec/models/inline_response_200_3_spec.rb +60 -0
- data/spec/models/inline_response_200_4_spec.rb +60 -0
- data/spec/models/inline_response_200_5_spec.rb +60 -0
- data/spec/models/inline_response_200_6_spec.rb +60 -0
- data/spec/models/inline_response_200_7_spec.rb +60 -0
- data/spec/models/inline_response_200_8_spec.rb +60 -0
- data/spec/models/inline_response_200_9_spec.rb +60 -0
- data/spec/models/inline_response_200_spec.rb +60 -0
- data/spec/models/inline_type_spec.rb +36 -0
- data/spec/models/input_contact_message_content_spec.rb +54 -0
- data/spec/models/input_location_message_content_spec.rb +48 -0
- data/spec/models/input_text_message_content_spec.rb +54 -0
- data/spec/models/input_venue_message_content_spec.rb +66 -0
- data/spec/models/invoice_spec.rb +66 -0
- data/spec/models/keyboard_button_spec.rb +54 -0
- data/spec/models/labeled_price_spec.rb +48 -0
- data/spec/models/location_spec.rb +48 -0
- data/spec/models/mask_position_spec.rb +64 -0
- data/spec/models/message_entity_spec.rb +70 -0
- data/spec/models/message_spec.rb +264 -0
- data/spec/models/order_info_spec.rb +60 -0
- data/spec/models/parse_mode_spec.rb +36 -0
- data/spec/models/photo_size_spec.rb +60 -0
- data/spec/models/pre_checkout_query_spec.rb +78 -0
- data/spec/models/promote_chat_member_body_spec.rb +96 -0
- data/spec/models/reply_keyboard_markup_spec.rb +60 -0
- data/spec/models/reply_keyboard_remove_spec.rb +48 -0
- data/spec/models/response_bool_spec.rb +60 -0
- data/spec/models/response_message_spec.rb +60 -0
- data/spec/models/response_parameters_spec.rb +48 -0
- data/spec/models/response_update_spec.rb +60 -0
- data/spec/models/restrict_chat_member_body_spec.rb +78 -0
- data/spec/models/send_audio_link_body_spec.rb +90 -0
- data/spec/models/send_contact_body_spec.rb +78 -0
- data/spec/models/send_document_link_body_spec.rb +72 -0
- data/spec/models/send_game_body_spec.rb +66 -0
- data/spec/models/send_invoice_body_spec.rb +156 -0
- data/spec/models/send_location_body_spec.rb +72 -0
- data/spec/models/send_message_body_spec.rb +78 -0
- data/spec/models/send_photo_link_body_spec.rb +72 -0
- data/spec/models/send_sticker_link_body_spec.rb +66 -0
- data/spec/models/send_venue_body_spec.rb +90 -0
- data/spec/models/send_video_link_body_spec.rb +90 -0
- data/spec/models/send_video_note_link_body_spec.rb +78 -0
- data/spec/models/send_voice_link_body_spec.rb +78 -0
- data/spec/models/shipping_address_spec.rb +72 -0
- data/spec/models/shipping_option_spec.rb +54 -0
- data/spec/models/shipping_query_spec.rb +60 -0
- data/spec/models/sticker_set_spec.rb +60 -0
- data/spec/models/sticker_spec.rb +84 -0
- data/spec/models/successful_payment_spec.rb +78 -0
- data/spec/models/update_spec.rb +96 -0
- data/spec/models/user_profile_photos_spec.rb +48 -0
- data/spec/models/user_spec.rb +72 -0
- data/spec/models/venue_spec.rb +60 -0
- data/spec/models/video_note_spec.rb +66 -0
- data/spec/models/video_spec.rb +78 -0
- data/spec/models/voice_spec.rb +60 -0
- data/spec/models/webhook_info_spec.rb +78 -0
- data/spec/spec_helper.rb +111 -0
- data/swagger.yaml +5202 -0
- data/teleswagger.gemspec +46 -0
- metadata +709 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Telegram bot API
|
|
3
|
+
|
|
4
|
+
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 3.3
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.2.3
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module Teleswagger
|
|
16
|
+
class CallbacksApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
#
|
|
25
|
+
# @param token bot's token to authorize the request
|
|
26
|
+
# @param callback_query_id
|
|
27
|
+
# @param text
|
|
28
|
+
# @param show_alert
|
|
29
|
+
# @param url
|
|
30
|
+
# @param cache_time
|
|
31
|
+
# @param [Hash] opts the optional parameters
|
|
32
|
+
# @return [ResponseBool]
|
|
33
|
+
def answer_callback_query(token, callback_query_id, text, show_alert, url, cache_time, opts = {})
|
|
34
|
+
data, _status_code, _headers = answer_callback_query_with_http_info(token, callback_query_id, text, show_alert, url, cache_time, opts)
|
|
35
|
+
return data
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
#
|
|
39
|
+
#
|
|
40
|
+
# @param token bot's token to authorize the request
|
|
41
|
+
# @param callback_query_id
|
|
42
|
+
# @param text
|
|
43
|
+
# @param show_alert
|
|
44
|
+
# @param url
|
|
45
|
+
# @param cache_time
|
|
46
|
+
# @param [Hash] opts the optional parameters
|
|
47
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
48
|
+
def answer_callback_query_with_http_info(token, callback_query_id, text, show_alert, url, cache_time, opts = {})
|
|
49
|
+
if @api_client.config.debugging
|
|
50
|
+
@api_client.config.logger.debug "Calling API: CallbacksApi.answer_callback_query ..."
|
|
51
|
+
end
|
|
52
|
+
# verify the required parameter 'token' is set
|
|
53
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
54
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling CallbacksApi.answer_callback_query"
|
|
55
|
+
end
|
|
56
|
+
# verify the required parameter 'callback_query_id' is set
|
|
57
|
+
if @api_client.config.client_side_validation && callback_query_id.nil?
|
|
58
|
+
fail ArgumentError, "Missing the required parameter 'callback_query_id' when calling CallbacksApi.answer_callback_query"
|
|
59
|
+
end
|
|
60
|
+
# verify the required parameter 'text' is set
|
|
61
|
+
if @api_client.config.client_side_validation && text.nil?
|
|
62
|
+
fail ArgumentError, "Missing the required parameter 'text' when calling CallbacksApi.answer_callback_query"
|
|
63
|
+
end
|
|
64
|
+
# verify the required parameter 'show_alert' is set
|
|
65
|
+
if @api_client.config.client_side_validation && show_alert.nil?
|
|
66
|
+
fail ArgumentError, "Missing the required parameter 'show_alert' when calling CallbacksApi.answer_callback_query"
|
|
67
|
+
end
|
|
68
|
+
# verify the required parameter 'url' is set
|
|
69
|
+
if @api_client.config.client_side_validation && url.nil?
|
|
70
|
+
fail ArgumentError, "Missing the required parameter 'url' when calling CallbacksApi.answer_callback_query"
|
|
71
|
+
end
|
|
72
|
+
# verify the required parameter 'cache_time' is set
|
|
73
|
+
if @api_client.config.client_side_validation && cache_time.nil?
|
|
74
|
+
fail ArgumentError, "Missing the required parameter 'cache_time' when calling CallbacksApi.answer_callback_query"
|
|
75
|
+
end
|
|
76
|
+
# resource path
|
|
77
|
+
local_var_path = "/bot{token}/answerCallbackQuery".sub('{' + 'token' + '}', token.to_s)
|
|
78
|
+
|
|
79
|
+
# query parameters
|
|
80
|
+
query_params = {}
|
|
81
|
+
|
|
82
|
+
# header parameters
|
|
83
|
+
header_params = {}
|
|
84
|
+
# HTTP header 'Accept' (if needed)
|
|
85
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
86
|
+
# HTTP header 'Content-Type'
|
|
87
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
|
|
88
|
+
|
|
89
|
+
# form parameters
|
|
90
|
+
form_params = {}
|
|
91
|
+
form_params["callback_query_id"] = callback_query_id
|
|
92
|
+
form_params["text"] = text
|
|
93
|
+
form_params["show_alert"] = show_alert
|
|
94
|
+
form_params["url"] = url
|
|
95
|
+
form_params["cache_time"] = cache_time
|
|
96
|
+
|
|
97
|
+
# http body (model)
|
|
98
|
+
post_body = nil
|
|
99
|
+
auth_names = []
|
|
100
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
101
|
+
:header_params => header_params,
|
|
102
|
+
:query_params => query_params,
|
|
103
|
+
:form_params => form_params,
|
|
104
|
+
:body => post_body,
|
|
105
|
+
:auth_names => auth_names,
|
|
106
|
+
:return_type => 'ResponseBool')
|
|
107
|
+
if @api_client.config.debugging
|
|
108
|
+
@api_client.config.logger.debug "API called: CallbacksApi#answer_callback_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
109
|
+
end
|
|
110
|
+
return data, status_code, headers
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -0,0 +1,1141 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Telegram bot API
|
|
3
|
+
|
|
4
|
+
#This is a swagger defenition for [Telegram bot API](https://core.telegram.org/bots/api).
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 3.3
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
Swagger Codegen version: 2.2.3
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require "uri"
|
|
14
|
+
|
|
15
|
+
module Teleswagger
|
|
16
|
+
class ChatsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
#
|
|
24
|
+
#
|
|
25
|
+
# @param token bot's token to authorize the request
|
|
26
|
+
# @param chat_id
|
|
27
|
+
# @param [Hash] opts the optional parameters
|
|
28
|
+
# @return [ResponseBool]
|
|
29
|
+
def delete_chat_photo(token, chat_id, opts = {})
|
|
30
|
+
data, _status_code, _headers = delete_chat_photo_with_http_info(token, chat_id, opts)
|
|
31
|
+
return data
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
#
|
|
35
|
+
#
|
|
36
|
+
# @param token bot's token to authorize the request
|
|
37
|
+
# @param chat_id
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
40
|
+
def delete_chat_photo_with_http_info(token, chat_id, opts = {})
|
|
41
|
+
if @api_client.config.debugging
|
|
42
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.delete_chat_photo ..."
|
|
43
|
+
end
|
|
44
|
+
# verify the required parameter 'token' is set
|
|
45
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
46
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.delete_chat_photo"
|
|
47
|
+
end
|
|
48
|
+
# verify the required parameter 'chat_id' is set
|
|
49
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
50
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.delete_chat_photo"
|
|
51
|
+
end
|
|
52
|
+
# resource path
|
|
53
|
+
local_var_path = "/bot{token}/deleteChatPhoto".sub('{' + 'token' + '}', token.to_s)
|
|
54
|
+
|
|
55
|
+
# query parameters
|
|
56
|
+
query_params = {}
|
|
57
|
+
query_params[:'chat_id'] = chat_id
|
|
58
|
+
|
|
59
|
+
# header parameters
|
|
60
|
+
header_params = {}
|
|
61
|
+
# HTTP header 'Accept' (if needed)
|
|
62
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
63
|
+
# HTTP header 'Content-Type'
|
|
64
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
65
|
+
|
|
66
|
+
# form parameters
|
|
67
|
+
form_params = {}
|
|
68
|
+
|
|
69
|
+
# http body (model)
|
|
70
|
+
post_body = nil
|
|
71
|
+
auth_names = []
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
73
|
+
:header_params => header_params,
|
|
74
|
+
:query_params => query_params,
|
|
75
|
+
:form_params => form_params,
|
|
76
|
+
:body => post_body,
|
|
77
|
+
:auth_names => auth_names,
|
|
78
|
+
:return_type => 'ResponseBool')
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: ChatsApi#delete_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
#
|
|
86
|
+
#
|
|
87
|
+
# @param token bot's token to authorize the request
|
|
88
|
+
# @param chat_id
|
|
89
|
+
# @param [Hash] opts the optional parameters
|
|
90
|
+
# @return [String]
|
|
91
|
+
def export_chat_invite_link(token, chat_id, opts = {})
|
|
92
|
+
data, _status_code, _headers = export_chat_invite_link_with_http_info(token, chat_id, opts)
|
|
93
|
+
return data
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
#
|
|
97
|
+
#
|
|
98
|
+
# @param token bot's token to authorize the request
|
|
99
|
+
# @param chat_id
|
|
100
|
+
# @param [Hash] opts the optional parameters
|
|
101
|
+
# @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers
|
|
102
|
+
def export_chat_invite_link_with_http_info(token, chat_id, opts = {})
|
|
103
|
+
if @api_client.config.debugging
|
|
104
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.export_chat_invite_link ..."
|
|
105
|
+
end
|
|
106
|
+
# verify the required parameter 'token' is set
|
|
107
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
108
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.export_chat_invite_link"
|
|
109
|
+
end
|
|
110
|
+
# verify the required parameter 'chat_id' is set
|
|
111
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
112
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.export_chat_invite_link"
|
|
113
|
+
end
|
|
114
|
+
# resource path
|
|
115
|
+
local_var_path = "/bot{token}/exportChatInviteLink".sub('{' + 'token' + '}', token.to_s)
|
|
116
|
+
|
|
117
|
+
# query parameters
|
|
118
|
+
query_params = {}
|
|
119
|
+
query_params[:'chat_id'] = chat_id
|
|
120
|
+
|
|
121
|
+
# header parameters
|
|
122
|
+
header_params = {}
|
|
123
|
+
# HTTP header 'Accept' (if needed)
|
|
124
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
125
|
+
# HTTP header 'Content-Type'
|
|
126
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
127
|
+
|
|
128
|
+
# form parameters
|
|
129
|
+
form_params = {}
|
|
130
|
+
|
|
131
|
+
# http body (model)
|
|
132
|
+
post_body = nil
|
|
133
|
+
auth_names = []
|
|
134
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
135
|
+
:header_params => header_params,
|
|
136
|
+
:query_params => query_params,
|
|
137
|
+
:form_params => form_params,
|
|
138
|
+
:body => post_body,
|
|
139
|
+
:auth_names => auth_names,
|
|
140
|
+
:return_type => 'String')
|
|
141
|
+
if @api_client.config.debugging
|
|
142
|
+
@api_client.config.logger.debug "API called: ChatsApi#export_chat_invite_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
143
|
+
end
|
|
144
|
+
return data, status_code, headers
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
#
|
|
148
|
+
#
|
|
149
|
+
# @param token bot's token to authorize the request
|
|
150
|
+
# @param chat_id
|
|
151
|
+
# @param [Hash] opts the optional parameters
|
|
152
|
+
# @return [InlineResponse2003]
|
|
153
|
+
def get_chat(token, chat_id, opts = {})
|
|
154
|
+
data, _status_code, _headers = get_chat_with_http_info(token, chat_id, opts)
|
|
155
|
+
return data
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
#
|
|
159
|
+
#
|
|
160
|
+
# @param token bot's token to authorize the request
|
|
161
|
+
# @param chat_id
|
|
162
|
+
# @param [Hash] opts the optional parameters
|
|
163
|
+
# @return [Array<(InlineResponse2003, Fixnum, Hash)>] InlineResponse2003 data, response status code and response headers
|
|
164
|
+
def get_chat_with_http_info(token, chat_id, opts = {})
|
|
165
|
+
if @api_client.config.debugging
|
|
166
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.get_chat ..."
|
|
167
|
+
end
|
|
168
|
+
# verify the required parameter 'token' is set
|
|
169
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
170
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat"
|
|
171
|
+
end
|
|
172
|
+
# verify the required parameter 'chat_id' is set
|
|
173
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
174
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat"
|
|
175
|
+
end
|
|
176
|
+
# resource path
|
|
177
|
+
local_var_path = "/bot{token}/getChat".sub('{' + 'token' + '}', token.to_s)
|
|
178
|
+
|
|
179
|
+
# query parameters
|
|
180
|
+
query_params = {}
|
|
181
|
+
query_params[:'chat_id'] = chat_id
|
|
182
|
+
|
|
183
|
+
# header parameters
|
|
184
|
+
header_params = {}
|
|
185
|
+
# HTTP header 'Accept' (if needed)
|
|
186
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
187
|
+
# HTTP header 'Content-Type'
|
|
188
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
189
|
+
|
|
190
|
+
# form parameters
|
|
191
|
+
form_params = {}
|
|
192
|
+
|
|
193
|
+
# http body (model)
|
|
194
|
+
post_body = nil
|
|
195
|
+
auth_names = []
|
|
196
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
197
|
+
:header_params => header_params,
|
|
198
|
+
:query_params => query_params,
|
|
199
|
+
:form_params => form_params,
|
|
200
|
+
:body => post_body,
|
|
201
|
+
:auth_names => auth_names,
|
|
202
|
+
:return_type => 'InlineResponse2003')
|
|
203
|
+
if @api_client.config.debugging
|
|
204
|
+
@api_client.config.logger.debug "API called: ChatsApi#get_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
205
|
+
end
|
|
206
|
+
return data, status_code, headers
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
#
|
|
210
|
+
#
|
|
211
|
+
# @param token bot's token to authorize the request
|
|
212
|
+
# @param chat_id
|
|
213
|
+
# @param [Hash] opts the optional parameters
|
|
214
|
+
# @return [InlineResponse2004]
|
|
215
|
+
def get_chat_administrators(token, chat_id, opts = {})
|
|
216
|
+
data, _status_code, _headers = get_chat_administrators_with_http_info(token, chat_id, opts)
|
|
217
|
+
return data
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
#
|
|
221
|
+
#
|
|
222
|
+
# @param token bot's token to authorize the request
|
|
223
|
+
# @param chat_id
|
|
224
|
+
# @param [Hash] opts the optional parameters
|
|
225
|
+
# @return [Array<(InlineResponse2004, Fixnum, Hash)>] InlineResponse2004 data, response status code and response headers
|
|
226
|
+
def get_chat_administrators_with_http_info(token, chat_id, opts = {})
|
|
227
|
+
if @api_client.config.debugging
|
|
228
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.get_chat_administrators ..."
|
|
229
|
+
end
|
|
230
|
+
# verify the required parameter 'token' is set
|
|
231
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
232
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_administrators"
|
|
233
|
+
end
|
|
234
|
+
# verify the required parameter 'chat_id' is set
|
|
235
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
236
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_administrators"
|
|
237
|
+
end
|
|
238
|
+
# resource path
|
|
239
|
+
local_var_path = "/bot{token}/getChatAdministrators".sub('{' + 'token' + '}', token.to_s)
|
|
240
|
+
|
|
241
|
+
# query parameters
|
|
242
|
+
query_params = {}
|
|
243
|
+
query_params[:'chat_id'] = chat_id
|
|
244
|
+
|
|
245
|
+
# header parameters
|
|
246
|
+
header_params = {}
|
|
247
|
+
# HTTP header 'Accept' (if needed)
|
|
248
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
249
|
+
# HTTP header 'Content-Type'
|
|
250
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
251
|
+
|
|
252
|
+
# form parameters
|
|
253
|
+
form_params = {}
|
|
254
|
+
|
|
255
|
+
# http body (model)
|
|
256
|
+
post_body = nil
|
|
257
|
+
auth_names = []
|
|
258
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
259
|
+
:header_params => header_params,
|
|
260
|
+
:query_params => query_params,
|
|
261
|
+
:form_params => form_params,
|
|
262
|
+
:body => post_body,
|
|
263
|
+
:auth_names => auth_names,
|
|
264
|
+
:return_type => 'InlineResponse2004')
|
|
265
|
+
if @api_client.config.debugging
|
|
266
|
+
@api_client.config.logger.debug "API called: ChatsApi#get_chat_administrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
267
|
+
end
|
|
268
|
+
return data, status_code, headers
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
#
|
|
272
|
+
#
|
|
273
|
+
# @param token bot's token to authorize the request
|
|
274
|
+
# @param chat_id
|
|
275
|
+
# @param user_id
|
|
276
|
+
# @param [Hash] opts the optional parameters
|
|
277
|
+
# @return [InlineResponse2006]
|
|
278
|
+
def get_chat_member(token, chat_id, user_id, opts = {})
|
|
279
|
+
data, _status_code, _headers = get_chat_member_with_http_info(token, chat_id, user_id, opts)
|
|
280
|
+
return data
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
#
|
|
284
|
+
#
|
|
285
|
+
# @param token bot's token to authorize the request
|
|
286
|
+
# @param chat_id
|
|
287
|
+
# @param user_id
|
|
288
|
+
# @param [Hash] opts the optional parameters
|
|
289
|
+
# @return [Array<(InlineResponse2006, Fixnum, Hash)>] InlineResponse2006 data, response status code and response headers
|
|
290
|
+
def get_chat_member_with_http_info(token, chat_id, user_id, opts = {})
|
|
291
|
+
if @api_client.config.debugging
|
|
292
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.get_chat_member ..."
|
|
293
|
+
end
|
|
294
|
+
# verify the required parameter 'token' is set
|
|
295
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
296
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_member"
|
|
297
|
+
end
|
|
298
|
+
# verify the required parameter 'chat_id' is set
|
|
299
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
300
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_member"
|
|
301
|
+
end
|
|
302
|
+
# verify the required parameter 'user_id' is set
|
|
303
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
304
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.get_chat_member"
|
|
305
|
+
end
|
|
306
|
+
# resource path
|
|
307
|
+
local_var_path = "/bot{token}/getChatMember".sub('{' + 'token' + '}', token.to_s)
|
|
308
|
+
|
|
309
|
+
# query parameters
|
|
310
|
+
query_params = {}
|
|
311
|
+
query_params[:'chat_id'] = chat_id
|
|
312
|
+
query_params[:'user_id'] = user_id
|
|
313
|
+
|
|
314
|
+
# header parameters
|
|
315
|
+
header_params = {}
|
|
316
|
+
# HTTP header 'Accept' (if needed)
|
|
317
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
318
|
+
# HTTP header 'Content-Type'
|
|
319
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
320
|
+
|
|
321
|
+
# form parameters
|
|
322
|
+
form_params = {}
|
|
323
|
+
|
|
324
|
+
# http body (model)
|
|
325
|
+
post_body = nil
|
|
326
|
+
auth_names = []
|
|
327
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
328
|
+
:header_params => header_params,
|
|
329
|
+
:query_params => query_params,
|
|
330
|
+
:form_params => form_params,
|
|
331
|
+
:body => post_body,
|
|
332
|
+
:auth_names => auth_names,
|
|
333
|
+
:return_type => 'InlineResponse2006')
|
|
334
|
+
if @api_client.config.debugging
|
|
335
|
+
@api_client.config.logger.debug "API called: ChatsApi#get_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
336
|
+
end
|
|
337
|
+
return data, status_code, headers
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
#
|
|
341
|
+
#
|
|
342
|
+
# @param token bot's token to authorize the request
|
|
343
|
+
# @param chat_id
|
|
344
|
+
# @param [Hash] opts the optional parameters
|
|
345
|
+
# @return [InlineResponse2005]
|
|
346
|
+
def get_chat_members_count(token, chat_id, opts = {})
|
|
347
|
+
data, _status_code, _headers = get_chat_members_count_with_http_info(token, chat_id, opts)
|
|
348
|
+
return data
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
#
|
|
352
|
+
#
|
|
353
|
+
# @param token bot's token to authorize the request
|
|
354
|
+
# @param chat_id
|
|
355
|
+
# @param [Hash] opts the optional parameters
|
|
356
|
+
# @return [Array<(InlineResponse2005, Fixnum, Hash)>] InlineResponse2005 data, response status code and response headers
|
|
357
|
+
def get_chat_members_count_with_http_info(token, chat_id, opts = {})
|
|
358
|
+
if @api_client.config.debugging
|
|
359
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.get_chat_members_count ..."
|
|
360
|
+
end
|
|
361
|
+
# verify the required parameter 'token' is set
|
|
362
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
363
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_members_count"
|
|
364
|
+
end
|
|
365
|
+
# verify the required parameter 'chat_id' is set
|
|
366
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
367
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_members_count"
|
|
368
|
+
end
|
|
369
|
+
# resource path
|
|
370
|
+
local_var_path = "/bot{token}/getChatMembersCount".sub('{' + 'token' + '}', token.to_s)
|
|
371
|
+
|
|
372
|
+
# query parameters
|
|
373
|
+
query_params = {}
|
|
374
|
+
query_params[:'chat_id'] = chat_id
|
|
375
|
+
|
|
376
|
+
# header parameters
|
|
377
|
+
header_params = {}
|
|
378
|
+
# HTTP header 'Accept' (if needed)
|
|
379
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
380
|
+
# HTTP header 'Content-Type'
|
|
381
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
382
|
+
|
|
383
|
+
# form parameters
|
|
384
|
+
form_params = {}
|
|
385
|
+
|
|
386
|
+
# http body (model)
|
|
387
|
+
post_body = nil
|
|
388
|
+
auth_names = []
|
|
389
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
390
|
+
:header_params => header_params,
|
|
391
|
+
:query_params => query_params,
|
|
392
|
+
:form_params => form_params,
|
|
393
|
+
:body => post_body,
|
|
394
|
+
:auth_names => auth_names,
|
|
395
|
+
:return_type => 'InlineResponse2005')
|
|
396
|
+
if @api_client.config.debugging
|
|
397
|
+
@api_client.config.logger.debug "API called: ChatsApi#get_chat_members_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
398
|
+
end
|
|
399
|
+
return data, status_code, headers
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
#
|
|
403
|
+
#
|
|
404
|
+
# @param token bot's token to authorize the request
|
|
405
|
+
# @param chat_id
|
|
406
|
+
# @param user_id
|
|
407
|
+
# @param [Hash] opts the optional parameters
|
|
408
|
+
# @option opts [Integer] :until_date
|
|
409
|
+
# @return [ResponseBool]
|
|
410
|
+
def kick_chat_member(token, chat_id, user_id, opts = {})
|
|
411
|
+
data, _status_code, _headers = kick_chat_member_with_http_info(token, chat_id, user_id, opts)
|
|
412
|
+
return data
|
|
413
|
+
end
|
|
414
|
+
|
|
415
|
+
#
|
|
416
|
+
#
|
|
417
|
+
# @param token bot's token to authorize the request
|
|
418
|
+
# @param chat_id
|
|
419
|
+
# @param user_id
|
|
420
|
+
# @param [Hash] opts the optional parameters
|
|
421
|
+
# @option opts [Integer] :until_date
|
|
422
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
423
|
+
def kick_chat_member_with_http_info(token, chat_id, user_id, opts = {})
|
|
424
|
+
if @api_client.config.debugging
|
|
425
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.kick_chat_member ..."
|
|
426
|
+
end
|
|
427
|
+
# verify the required parameter 'token' is set
|
|
428
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
429
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.kick_chat_member"
|
|
430
|
+
end
|
|
431
|
+
# verify the required parameter 'chat_id' is set
|
|
432
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
433
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.kick_chat_member"
|
|
434
|
+
end
|
|
435
|
+
# verify the required parameter 'user_id' is set
|
|
436
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
437
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.kick_chat_member"
|
|
438
|
+
end
|
|
439
|
+
# resource path
|
|
440
|
+
local_var_path = "/bot{token}/kickChatMember".sub('{' + 'token' + '}', token.to_s)
|
|
441
|
+
|
|
442
|
+
# query parameters
|
|
443
|
+
query_params = {}
|
|
444
|
+
query_params[:'chat_id'] = chat_id
|
|
445
|
+
query_params[:'user_id'] = user_id
|
|
446
|
+
query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil?
|
|
447
|
+
|
|
448
|
+
# header parameters
|
|
449
|
+
header_params = {}
|
|
450
|
+
# HTTP header 'Accept' (if needed)
|
|
451
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
452
|
+
# HTTP header 'Content-Type'
|
|
453
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
454
|
+
|
|
455
|
+
# form parameters
|
|
456
|
+
form_params = {}
|
|
457
|
+
|
|
458
|
+
# http body (model)
|
|
459
|
+
post_body = nil
|
|
460
|
+
auth_names = []
|
|
461
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
462
|
+
:header_params => header_params,
|
|
463
|
+
:query_params => query_params,
|
|
464
|
+
:form_params => form_params,
|
|
465
|
+
:body => post_body,
|
|
466
|
+
:auth_names => auth_names,
|
|
467
|
+
:return_type => 'ResponseBool')
|
|
468
|
+
if @api_client.config.debugging
|
|
469
|
+
@api_client.config.logger.debug "API called: ChatsApi#kick_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
470
|
+
end
|
|
471
|
+
return data, status_code, headers
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
#
|
|
475
|
+
#
|
|
476
|
+
# @param token bot's token to authorize the request
|
|
477
|
+
# @param chat_id
|
|
478
|
+
# @param [Hash] opts the optional parameters
|
|
479
|
+
# @return [ResponseBool]
|
|
480
|
+
def leave_chat(token, chat_id, opts = {})
|
|
481
|
+
data, _status_code, _headers = leave_chat_with_http_info(token, chat_id, opts)
|
|
482
|
+
return data
|
|
483
|
+
end
|
|
484
|
+
|
|
485
|
+
#
|
|
486
|
+
#
|
|
487
|
+
# @param token bot's token to authorize the request
|
|
488
|
+
# @param chat_id
|
|
489
|
+
# @param [Hash] opts the optional parameters
|
|
490
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
491
|
+
def leave_chat_with_http_info(token, chat_id, opts = {})
|
|
492
|
+
if @api_client.config.debugging
|
|
493
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.leave_chat ..."
|
|
494
|
+
end
|
|
495
|
+
# verify the required parameter 'token' is set
|
|
496
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
497
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.leave_chat"
|
|
498
|
+
end
|
|
499
|
+
# verify the required parameter 'chat_id' is set
|
|
500
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
501
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.leave_chat"
|
|
502
|
+
end
|
|
503
|
+
# resource path
|
|
504
|
+
local_var_path = "/bot{token}/leaveChat".sub('{' + 'token' + '}', token.to_s)
|
|
505
|
+
|
|
506
|
+
# query parameters
|
|
507
|
+
query_params = {}
|
|
508
|
+
query_params[:'chat_id'] = chat_id
|
|
509
|
+
|
|
510
|
+
# header parameters
|
|
511
|
+
header_params = {}
|
|
512
|
+
# HTTP header 'Accept' (if needed)
|
|
513
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
514
|
+
# HTTP header 'Content-Type'
|
|
515
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
516
|
+
|
|
517
|
+
# form parameters
|
|
518
|
+
form_params = {}
|
|
519
|
+
|
|
520
|
+
# http body (model)
|
|
521
|
+
post_body = nil
|
|
522
|
+
auth_names = []
|
|
523
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
524
|
+
:header_params => header_params,
|
|
525
|
+
:query_params => query_params,
|
|
526
|
+
:form_params => form_params,
|
|
527
|
+
:body => post_body,
|
|
528
|
+
:auth_names => auth_names,
|
|
529
|
+
:return_type => 'ResponseBool')
|
|
530
|
+
if @api_client.config.debugging
|
|
531
|
+
@api_client.config.logger.debug "API called: ChatsApi#leave_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
532
|
+
end
|
|
533
|
+
return data, status_code, headers
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
#
|
|
537
|
+
#
|
|
538
|
+
# @param token bot's token to authorize the request
|
|
539
|
+
# @param chat_id
|
|
540
|
+
# @param message_id
|
|
541
|
+
# @param [Hash] opts the optional parameters
|
|
542
|
+
# @option opts [BOOLEAN] :disable_notification
|
|
543
|
+
# @return [ResponseBool]
|
|
544
|
+
def pin_chat_message(token, chat_id, message_id, opts = {})
|
|
545
|
+
data, _status_code, _headers = pin_chat_message_with_http_info(token, chat_id, message_id, opts)
|
|
546
|
+
return data
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
#
|
|
550
|
+
#
|
|
551
|
+
# @param token bot's token to authorize the request
|
|
552
|
+
# @param chat_id
|
|
553
|
+
# @param message_id
|
|
554
|
+
# @param [Hash] opts the optional parameters
|
|
555
|
+
# @option opts [BOOLEAN] :disable_notification
|
|
556
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
557
|
+
def pin_chat_message_with_http_info(token, chat_id, message_id, opts = {})
|
|
558
|
+
if @api_client.config.debugging
|
|
559
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.pin_chat_message ..."
|
|
560
|
+
end
|
|
561
|
+
# verify the required parameter 'token' is set
|
|
562
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
563
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.pin_chat_message"
|
|
564
|
+
end
|
|
565
|
+
# verify the required parameter 'chat_id' is set
|
|
566
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
567
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.pin_chat_message"
|
|
568
|
+
end
|
|
569
|
+
# verify the required parameter 'message_id' is set
|
|
570
|
+
if @api_client.config.client_side_validation && message_id.nil?
|
|
571
|
+
fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatsApi.pin_chat_message"
|
|
572
|
+
end
|
|
573
|
+
# resource path
|
|
574
|
+
local_var_path = "/bot{token}/pinChatMessage".sub('{' + 'token' + '}', token.to_s)
|
|
575
|
+
|
|
576
|
+
# query parameters
|
|
577
|
+
query_params = {}
|
|
578
|
+
query_params[:'chat_id'] = chat_id
|
|
579
|
+
query_params[:'message_id'] = message_id
|
|
580
|
+
query_params[:'disable_notification'] = opts[:'disable_notification'] if !opts[:'disable_notification'].nil?
|
|
581
|
+
|
|
582
|
+
# header parameters
|
|
583
|
+
header_params = {}
|
|
584
|
+
# HTTP header 'Accept' (if needed)
|
|
585
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
586
|
+
# HTTP header 'Content-Type'
|
|
587
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
588
|
+
|
|
589
|
+
# form parameters
|
|
590
|
+
form_params = {}
|
|
591
|
+
|
|
592
|
+
# http body (model)
|
|
593
|
+
post_body = nil
|
|
594
|
+
auth_names = []
|
|
595
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
596
|
+
:header_params => header_params,
|
|
597
|
+
:query_params => query_params,
|
|
598
|
+
:form_params => form_params,
|
|
599
|
+
:body => post_body,
|
|
600
|
+
:auth_names => auth_names,
|
|
601
|
+
:return_type => 'ResponseBool')
|
|
602
|
+
if @api_client.config.debugging
|
|
603
|
+
@api_client.config.logger.debug "API called: ChatsApi#pin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
604
|
+
end
|
|
605
|
+
return data, status_code, headers
|
|
606
|
+
end
|
|
607
|
+
|
|
608
|
+
#
|
|
609
|
+
#
|
|
610
|
+
# @param token bot's token to authorize the request
|
|
611
|
+
# @param body
|
|
612
|
+
# @param [Hash] opts the optional parameters
|
|
613
|
+
# @return [ResponseBool]
|
|
614
|
+
def promote_chat_member(token, body, opts = {})
|
|
615
|
+
data, _status_code, _headers = promote_chat_member_with_http_info(token, body, opts)
|
|
616
|
+
return data
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
#
|
|
620
|
+
#
|
|
621
|
+
# @param token bot's token to authorize the request
|
|
622
|
+
# @param body
|
|
623
|
+
# @param [Hash] opts the optional parameters
|
|
624
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
625
|
+
def promote_chat_member_with_http_info(token, body, opts = {})
|
|
626
|
+
if @api_client.config.debugging
|
|
627
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.promote_chat_member ..."
|
|
628
|
+
end
|
|
629
|
+
# verify the required parameter 'token' is set
|
|
630
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
631
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.promote_chat_member"
|
|
632
|
+
end
|
|
633
|
+
# verify the required parameter 'body' is set
|
|
634
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
635
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.promote_chat_member"
|
|
636
|
+
end
|
|
637
|
+
# resource path
|
|
638
|
+
local_var_path = "/bot{token}/promoteChatMember".sub('{' + 'token' + '}', token.to_s)
|
|
639
|
+
|
|
640
|
+
# query parameters
|
|
641
|
+
query_params = {}
|
|
642
|
+
|
|
643
|
+
# header parameters
|
|
644
|
+
header_params = {}
|
|
645
|
+
# HTTP header 'Accept' (if needed)
|
|
646
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
647
|
+
# HTTP header 'Content-Type'
|
|
648
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
649
|
+
|
|
650
|
+
# form parameters
|
|
651
|
+
form_params = {}
|
|
652
|
+
|
|
653
|
+
# http body (model)
|
|
654
|
+
post_body = @api_client.object_to_http_body(body)
|
|
655
|
+
auth_names = []
|
|
656
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
657
|
+
:header_params => header_params,
|
|
658
|
+
:query_params => query_params,
|
|
659
|
+
:form_params => form_params,
|
|
660
|
+
:body => post_body,
|
|
661
|
+
:auth_names => auth_names,
|
|
662
|
+
:return_type => 'ResponseBool')
|
|
663
|
+
if @api_client.config.debugging
|
|
664
|
+
@api_client.config.logger.debug "API called: ChatsApi#promote_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
665
|
+
end
|
|
666
|
+
return data, status_code, headers
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
#
|
|
670
|
+
#
|
|
671
|
+
# @param token bot's token to authorize the request
|
|
672
|
+
# @param body
|
|
673
|
+
# @param [Hash] opts the optional parameters
|
|
674
|
+
# @return [ResponseBool]
|
|
675
|
+
def restrict_chat_member(token, body, opts = {})
|
|
676
|
+
data, _status_code, _headers = restrict_chat_member_with_http_info(token, body, opts)
|
|
677
|
+
return data
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
#
|
|
681
|
+
#
|
|
682
|
+
# @param token bot's token to authorize the request
|
|
683
|
+
# @param body
|
|
684
|
+
# @param [Hash] opts the optional parameters
|
|
685
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
686
|
+
def restrict_chat_member_with_http_info(token, body, opts = {})
|
|
687
|
+
if @api_client.config.debugging
|
|
688
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.restrict_chat_member ..."
|
|
689
|
+
end
|
|
690
|
+
# verify the required parameter 'token' is set
|
|
691
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
692
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.restrict_chat_member"
|
|
693
|
+
end
|
|
694
|
+
# verify the required parameter 'body' is set
|
|
695
|
+
if @api_client.config.client_side_validation && body.nil?
|
|
696
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.restrict_chat_member"
|
|
697
|
+
end
|
|
698
|
+
# resource path
|
|
699
|
+
local_var_path = "/bot{token}/restrictChatMember".sub('{' + 'token' + '}', token.to_s)
|
|
700
|
+
|
|
701
|
+
# query parameters
|
|
702
|
+
query_params = {}
|
|
703
|
+
|
|
704
|
+
# header parameters
|
|
705
|
+
header_params = {}
|
|
706
|
+
# HTTP header 'Accept' (if needed)
|
|
707
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
708
|
+
# HTTP header 'Content-Type'
|
|
709
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
710
|
+
|
|
711
|
+
# form parameters
|
|
712
|
+
form_params = {}
|
|
713
|
+
|
|
714
|
+
# http body (model)
|
|
715
|
+
post_body = @api_client.object_to_http_body(body)
|
|
716
|
+
auth_names = []
|
|
717
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
718
|
+
:header_params => header_params,
|
|
719
|
+
:query_params => query_params,
|
|
720
|
+
:form_params => form_params,
|
|
721
|
+
:body => post_body,
|
|
722
|
+
:auth_names => auth_names,
|
|
723
|
+
:return_type => 'ResponseBool')
|
|
724
|
+
if @api_client.config.debugging
|
|
725
|
+
@api_client.config.logger.debug "API called: ChatsApi#restrict_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
726
|
+
end
|
|
727
|
+
return data, status_code, headers
|
|
728
|
+
end
|
|
729
|
+
|
|
730
|
+
#
|
|
731
|
+
#
|
|
732
|
+
# @param token bot's token to authorize the request
|
|
733
|
+
# @param chat_id
|
|
734
|
+
# @param action
|
|
735
|
+
# @param [Hash] opts the optional parameters
|
|
736
|
+
# @return [ResponseBool]
|
|
737
|
+
def send_chat_action(token, chat_id, action, opts = {})
|
|
738
|
+
data, _status_code, _headers = send_chat_action_with_http_info(token, chat_id, action, opts)
|
|
739
|
+
return data
|
|
740
|
+
end
|
|
741
|
+
|
|
742
|
+
#
|
|
743
|
+
#
|
|
744
|
+
# @param token bot's token to authorize the request
|
|
745
|
+
# @param chat_id
|
|
746
|
+
# @param action
|
|
747
|
+
# @param [Hash] opts the optional parameters
|
|
748
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
749
|
+
def send_chat_action_with_http_info(token, chat_id, action, opts = {})
|
|
750
|
+
if @api_client.config.debugging
|
|
751
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.send_chat_action ..."
|
|
752
|
+
end
|
|
753
|
+
# verify the required parameter 'token' is set
|
|
754
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
755
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.send_chat_action"
|
|
756
|
+
end
|
|
757
|
+
# verify the required parameter 'chat_id' is set
|
|
758
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
759
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.send_chat_action"
|
|
760
|
+
end
|
|
761
|
+
# verify the required parameter 'action' is set
|
|
762
|
+
if @api_client.config.client_side_validation && action.nil?
|
|
763
|
+
fail ArgumentError, "Missing the required parameter 'action' when calling ChatsApi.send_chat_action"
|
|
764
|
+
end
|
|
765
|
+
# verify enum value
|
|
766
|
+
if @api_client.config.client_side_validation && !['typing', 'upload_photo', 'record_video', 'upload_video', 'record_audio', 'upload_audio', 'upload_document', 'find_location', 'record_video_note', 'upload_video_note'].include?(action)
|
|
767
|
+
fail ArgumentError, "invalid value for 'action', must be one of typing, upload_photo, record_video, upload_video, record_audio, upload_audio, upload_document, find_location, record_video_note, upload_video_note"
|
|
768
|
+
end
|
|
769
|
+
# resource path
|
|
770
|
+
local_var_path = "/bot{token}/sendChatAction".sub('{' + 'token' + '}', token.to_s)
|
|
771
|
+
|
|
772
|
+
# query parameters
|
|
773
|
+
query_params = {}
|
|
774
|
+
query_params[:'chat_id'] = chat_id
|
|
775
|
+
query_params[:'action'] = action
|
|
776
|
+
|
|
777
|
+
# header parameters
|
|
778
|
+
header_params = {}
|
|
779
|
+
# HTTP header 'Accept' (if needed)
|
|
780
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
781
|
+
# HTTP header 'Content-Type'
|
|
782
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
783
|
+
|
|
784
|
+
# form parameters
|
|
785
|
+
form_params = {}
|
|
786
|
+
|
|
787
|
+
# http body (model)
|
|
788
|
+
post_body = nil
|
|
789
|
+
auth_names = []
|
|
790
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
791
|
+
:header_params => header_params,
|
|
792
|
+
:query_params => query_params,
|
|
793
|
+
:form_params => form_params,
|
|
794
|
+
:body => post_body,
|
|
795
|
+
:auth_names => auth_names,
|
|
796
|
+
:return_type => 'ResponseBool')
|
|
797
|
+
if @api_client.config.debugging
|
|
798
|
+
@api_client.config.logger.debug "API called: ChatsApi#send_chat_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
799
|
+
end
|
|
800
|
+
return data, status_code, headers
|
|
801
|
+
end
|
|
802
|
+
|
|
803
|
+
#
|
|
804
|
+
#
|
|
805
|
+
# @param token bot's token to authorize the request
|
|
806
|
+
# @param chat_id
|
|
807
|
+
# @param description
|
|
808
|
+
# @param [Hash] opts the optional parameters
|
|
809
|
+
# @return [ResponseBool]
|
|
810
|
+
def set_chat_description(token, chat_id, description, opts = {})
|
|
811
|
+
data, _status_code, _headers = set_chat_description_with_http_info(token, chat_id, description, opts)
|
|
812
|
+
return data
|
|
813
|
+
end
|
|
814
|
+
|
|
815
|
+
#
|
|
816
|
+
#
|
|
817
|
+
# @param token bot's token to authorize the request
|
|
818
|
+
# @param chat_id
|
|
819
|
+
# @param description
|
|
820
|
+
# @param [Hash] opts the optional parameters
|
|
821
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
822
|
+
def set_chat_description_with_http_info(token, chat_id, description, opts = {})
|
|
823
|
+
if @api_client.config.debugging
|
|
824
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.set_chat_description ..."
|
|
825
|
+
end
|
|
826
|
+
# verify the required parameter 'token' is set
|
|
827
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
828
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_description"
|
|
829
|
+
end
|
|
830
|
+
# verify the required parameter 'chat_id' is set
|
|
831
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
832
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_description"
|
|
833
|
+
end
|
|
834
|
+
# verify the required parameter 'description' is set
|
|
835
|
+
if @api_client.config.client_side_validation && description.nil?
|
|
836
|
+
fail ArgumentError, "Missing the required parameter 'description' when calling ChatsApi.set_chat_description"
|
|
837
|
+
end
|
|
838
|
+
# resource path
|
|
839
|
+
local_var_path = "/bot{token}/setChatDescription".sub('{' + 'token' + '}', token.to_s)
|
|
840
|
+
|
|
841
|
+
# query parameters
|
|
842
|
+
query_params = {}
|
|
843
|
+
query_params[:'chat_id'] = chat_id
|
|
844
|
+
query_params[:'description'] = description
|
|
845
|
+
|
|
846
|
+
# header parameters
|
|
847
|
+
header_params = {}
|
|
848
|
+
# HTTP header 'Accept' (if needed)
|
|
849
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
850
|
+
# HTTP header 'Content-Type'
|
|
851
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
852
|
+
|
|
853
|
+
# form parameters
|
|
854
|
+
form_params = {}
|
|
855
|
+
|
|
856
|
+
# http body (model)
|
|
857
|
+
post_body = nil
|
|
858
|
+
auth_names = []
|
|
859
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
860
|
+
:header_params => header_params,
|
|
861
|
+
:query_params => query_params,
|
|
862
|
+
:form_params => form_params,
|
|
863
|
+
:body => post_body,
|
|
864
|
+
:auth_names => auth_names,
|
|
865
|
+
:return_type => 'ResponseBool')
|
|
866
|
+
if @api_client.config.debugging
|
|
867
|
+
@api_client.config.logger.debug "API called: ChatsApi#set_chat_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
868
|
+
end
|
|
869
|
+
return data, status_code, headers
|
|
870
|
+
end
|
|
871
|
+
|
|
872
|
+
#
|
|
873
|
+
#
|
|
874
|
+
# @param token bot's token to authorize the request
|
|
875
|
+
# @param chat_id
|
|
876
|
+
# @param photo
|
|
877
|
+
# @param [Hash] opts the optional parameters
|
|
878
|
+
# @return [ResponseBool]
|
|
879
|
+
def set_chat_photo(token, chat_id, photo, opts = {})
|
|
880
|
+
data, _status_code, _headers = set_chat_photo_with_http_info(token, chat_id, photo, opts)
|
|
881
|
+
return data
|
|
882
|
+
end
|
|
883
|
+
|
|
884
|
+
#
|
|
885
|
+
#
|
|
886
|
+
# @param token bot's token to authorize the request
|
|
887
|
+
# @param chat_id
|
|
888
|
+
# @param photo
|
|
889
|
+
# @param [Hash] opts the optional parameters
|
|
890
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
891
|
+
def set_chat_photo_with_http_info(token, chat_id, photo, opts = {})
|
|
892
|
+
if @api_client.config.debugging
|
|
893
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.set_chat_photo ..."
|
|
894
|
+
end
|
|
895
|
+
# verify the required parameter 'token' is set
|
|
896
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
897
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_photo"
|
|
898
|
+
end
|
|
899
|
+
# verify the required parameter 'chat_id' is set
|
|
900
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
901
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_photo"
|
|
902
|
+
end
|
|
903
|
+
# verify the required parameter 'photo' is set
|
|
904
|
+
if @api_client.config.client_side_validation && photo.nil?
|
|
905
|
+
fail ArgumentError, "Missing the required parameter 'photo' when calling ChatsApi.set_chat_photo"
|
|
906
|
+
end
|
|
907
|
+
# resource path
|
|
908
|
+
local_var_path = "/bot{token}/setChatPhoto".sub('{' + 'token' + '}', token.to_s)
|
|
909
|
+
|
|
910
|
+
# query parameters
|
|
911
|
+
query_params = {}
|
|
912
|
+
|
|
913
|
+
# header parameters
|
|
914
|
+
header_params = {}
|
|
915
|
+
# HTTP header 'Accept' (if needed)
|
|
916
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
917
|
+
# HTTP header 'Content-Type'
|
|
918
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
|
919
|
+
|
|
920
|
+
# form parameters
|
|
921
|
+
form_params = {}
|
|
922
|
+
form_params["chat_id"] = chat_id
|
|
923
|
+
form_params["photo"] = photo
|
|
924
|
+
|
|
925
|
+
# http body (model)
|
|
926
|
+
post_body = nil
|
|
927
|
+
auth_names = []
|
|
928
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
929
|
+
:header_params => header_params,
|
|
930
|
+
:query_params => query_params,
|
|
931
|
+
:form_params => form_params,
|
|
932
|
+
:body => post_body,
|
|
933
|
+
:auth_names => auth_names,
|
|
934
|
+
:return_type => 'ResponseBool')
|
|
935
|
+
if @api_client.config.debugging
|
|
936
|
+
@api_client.config.logger.debug "API called: ChatsApi#set_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
937
|
+
end
|
|
938
|
+
return data, status_code, headers
|
|
939
|
+
end
|
|
940
|
+
|
|
941
|
+
#
|
|
942
|
+
#
|
|
943
|
+
# @param token bot's token to authorize the request
|
|
944
|
+
# @param chat_id
|
|
945
|
+
# @param title
|
|
946
|
+
# @param [Hash] opts the optional parameters
|
|
947
|
+
# @return [ResponseBool]
|
|
948
|
+
def set_chat_title(token, chat_id, title, opts = {})
|
|
949
|
+
data, _status_code, _headers = set_chat_title_with_http_info(token, chat_id, title, opts)
|
|
950
|
+
return data
|
|
951
|
+
end
|
|
952
|
+
|
|
953
|
+
#
|
|
954
|
+
#
|
|
955
|
+
# @param token bot's token to authorize the request
|
|
956
|
+
# @param chat_id
|
|
957
|
+
# @param title
|
|
958
|
+
# @param [Hash] opts the optional parameters
|
|
959
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
960
|
+
def set_chat_title_with_http_info(token, chat_id, title, opts = {})
|
|
961
|
+
if @api_client.config.debugging
|
|
962
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.set_chat_title ..."
|
|
963
|
+
end
|
|
964
|
+
# verify the required parameter 'token' is set
|
|
965
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
966
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_title"
|
|
967
|
+
end
|
|
968
|
+
# verify the required parameter 'chat_id' is set
|
|
969
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
970
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_title"
|
|
971
|
+
end
|
|
972
|
+
# verify the required parameter 'title' is set
|
|
973
|
+
if @api_client.config.client_side_validation && title.nil?
|
|
974
|
+
fail ArgumentError, "Missing the required parameter 'title' when calling ChatsApi.set_chat_title"
|
|
975
|
+
end
|
|
976
|
+
# resource path
|
|
977
|
+
local_var_path = "/bot{token}/setChatTitle".sub('{' + 'token' + '}', token.to_s)
|
|
978
|
+
|
|
979
|
+
# query parameters
|
|
980
|
+
query_params = {}
|
|
981
|
+
query_params[:'chat_id'] = chat_id
|
|
982
|
+
query_params[:'title'] = title
|
|
983
|
+
|
|
984
|
+
# header parameters
|
|
985
|
+
header_params = {}
|
|
986
|
+
# HTTP header 'Accept' (if needed)
|
|
987
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
988
|
+
# HTTP header 'Content-Type'
|
|
989
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
990
|
+
|
|
991
|
+
# form parameters
|
|
992
|
+
form_params = {}
|
|
993
|
+
|
|
994
|
+
# http body (model)
|
|
995
|
+
post_body = nil
|
|
996
|
+
auth_names = []
|
|
997
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
998
|
+
:header_params => header_params,
|
|
999
|
+
:query_params => query_params,
|
|
1000
|
+
:form_params => form_params,
|
|
1001
|
+
:body => post_body,
|
|
1002
|
+
:auth_names => auth_names,
|
|
1003
|
+
:return_type => 'ResponseBool')
|
|
1004
|
+
if @api_client.config.debugging
|
|
1005
|
+
@api_client.config.logger.debug "API called: ChatsApi#set_chat_title\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1006
|
+
end
|
|
1007
|
+
return data, status_code, headers
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
#
|
|
1011
|
+
#
|
|
1012
|
+
# @param token bot's token to authorize the request
|
|
1013
|
+
# @param chat_id
|
|
1014
|
+
# @param user_id
|
|
1015
|
+
# @param [Hash] opts the optional parameters
|
|
1016
|
+
# @return [ResponseBool]
|
|
1017
|
+
def unban_chat_member(token, chat_id, user_id, opts = {})
|
|
1018
|
+
data, _status_code, _headers = unban_chat_member_with_http_info(token, chat_id, user_id, opts)
|
|
1019
|
+
return data
|
|
1020
|
+
end
|
|
1021
|
+
|
|
1022
|
+
#
|
|
1023
|
+
#
|
|
1024
|
+
# @param token bot's token to authorize the request
|
|
1025
|
+
# @param chat_id
|
|
1026
|
+
# @param user_id
|
|
1027
|
+
# @param [Hash] opts the optional parameters
|
|
1028
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
1029
|
+
def unban_chat_member_with_http_info(token, chat_id, user_id, opts = {})
|
|
1030
|
+
if @api_client.config.debugging
|
|
1031
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.unban_chat_member ..."
|
|
1032
|
+
end
|
|
1033
|
+
# verify the required parameter 'token' is set
|
|
1034
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
1035
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unban_chat_member"
|
|
1036
|
+
end
|
|
1037
|
+
# verify the required parameter 'chat_id' is set
|
|
1038
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
1039
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unban_chat_member"
|
|
1040
|
+
end
|
|
1041
|
+
# verify the required parameter 'user_id' is set
|
|
1042
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
|
1043
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.unban_chat_member"
|
|
1044
|
+
end
|
|
1045
|
+
# resource path
|
|
1046
|
+
local_var_path = "/bot{token}/unbanChatMember".sub('{' + 'token' + '}', token.to_s)
|
|
1047
|
+
|
|
1048
|
+
# query parameters
|
|
1049
|
+
query_params = {}
|
|
1050
|
+
query_params[:'chat_id'] = chat_id
|
|
1051
|
+
query_params[:'user_id'] = user_id
|
|
1052
|
+
|
|
1053
|
+
# header parameters
|
|
1054
|
+
header_params = {}
|
|
1055
|
+
# HTTP header 'Accept' (if needed)
|
|
1056
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1057
|
+
# HTTP header 'Content-Type'
|
|
1058
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
1059
|
+
|
|
1060
|
+
# form parameters
|
|
1061
|
+
form_params = {}
|
|
1062
|
+
|
|
1063
|
+
# http body (model)
|
|
1064
|
+
post_body = nil
|
|
1065
|
+
auth_names = []
|
|
1066
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
1067
|
+
:header_params => header_params,
|
|
1068
|
+
:query_params => query_params,
|
|
1069
|
+
:form_params => form_params,
|
|
1070
|
+
:body => post_body,
|
|
1071
|
+
:auth_names => auth_names,
|
|
1072
|
+
:return_type => 'ResponseBool')
|
|
1073
|
+
if @api_client.config.debugging
|
|
1074
|
+
@api_client.config.logger.debug "API called: ChatsApi#unban_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1075
|
+
end
|
|
1076
|
+
return data, status_code, headers
|
|
1077
|
+
end
|
|
1078
|
+
|
|
1079
|
+
#
|
|
1080
|
+
#
|
|
1081
|
+
# @param token bot's token to authorize the request
|
|
1082
|
+
# @param chat_id
|
|
1083
|
+
# @param [Hash] opts the optional parameters
|
|
1084
|
+
# @return [ResponseBool]
|
|
1085
|
+
def unpin_chat_message(token, chat_id, opts = {})
|
|
1086
|
+
data, _status_code, _headers = unpin_chat_message_with_http_info(token, chat_id, opts)
|
|
1087
|
+
return data
|
|
1088
|
+
end
|
|
1089
|
+
|
|
1090
|
+
#
|
|
1091
|
+
#
|
|
1092
|
+
# @param token bot's token to authorize the request
|
|
1093
|
+
# @param chat_id
|
|
1094
|
+
# @param [Hash] opts the optional parameters
|
|
1095
|
+
# @return [Array<(ResponseBool, Fixnum, Hash)>] ResponseBool data, response status code and response headers
|
|
1096
|
+
def unpin_chat_message_with_http_info(token, chat_id, opts = {})
|
|
1097
|
+
if @api_client.config.debugging
|
|
1098
|
+
@api_client.config.logger.debug "Calling API: ChatsApi.unpin_chat_message ..."
|
|
1099
|
+
end
|
|
1100
|
+
# verify the required parameter 'token' is set
|
|
1101
|
+
if @api_client.config.client_side_validation && token.nil?
|
|
1102
|
+
fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unpin_chat_message"
|
|
1103
|
+
end
|
|
1104
|
+
# verify the required parameter 'chat_id' is set
|
|
1105
|
+
if @api_client.config.client_side_validation && chat_id.nil?
|
|
1106
|
+
fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unpin_chat_message"
|
|
1107
|
+
end
|
|
1108
|
+
# resource path
|
|
1109
|
+
local_var_path = "/bot{token}/unpinChatMessage".sub('{' + 'token' + '}', token.to_s)
|
|
1110
|
+
|
|
1111
|
+
# query parameters
|
|
1112
|
+
query_params = {}
|
|
1113
|
+
query_params[:'chat_id'] = chat_id
|
|
1114
|
+
|
|
1115
|
+
# header parameters
|
|
1116
|
+
header_params = {}
|
|
1117
|
+
# HTTP header 'Accept' (if needed)
|
|
1118
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
1119
|
+
# HTTP header 'Content-Type'
|
|
1120
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
1121
|
+
|
|
1122
|
+
# form parameters
|
|
1123
|
+
form_params = {}
|
|
1124
|
+
|
|
1125
|
+
# http body (model)
|
|
1126
|
+
post_body = nil
|
|
1127
|
+
auth_names = []
|
|
1128
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
|
1129
|
+
:header_params => header_params,
|
|
1130
|
+
:query_params => query_params,
|
|
1131
|
+
:form_params => form_params,
|
|
1132
|
+
:body => post_body,
|
|
1133
|
+
:auth_names => auth_names,
|
|
1134
|
+
:return_type => 'ResponseBool')
|
|
1135
|
+
if @api_client.config.debugging
|
|
1136
|
+
@api_client.config.logger.debug "API called: ChatsApi#unpin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
1137
|
+
end
|
|
1138
|
+
return data, status_code, headers
|
|
1139
|
+
end
|
|
1140
|
+
end
|
|
1141
|
+
end
|