Class: Teleswagger::ChatsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/teleswagger/api/chats_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ChatsApi

Returns a new instance of ChatsApi.



19
20
21
# File 'lib/teleswagger/api/chats_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/teleswagger/api/chats_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_chat_photo(token, chat_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot's token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



29
30
31
32
# File 'lib/teleswagger/api/chats_api.rb', line 29

def delete_chat_photo(token, chat_id, opts = {})
  data, _status_code, _headers = delete_chat_photo_with_http_info(token, chat_id, opts)
  return data
end

#delete_chat_photo_with_http_info(token, chat_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/teleswagger/api/chats_api.rb', line 40

def delete_chat_photo_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.delete_chat_photo ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.delete_chat_photo"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.delete_chat_photo"
  end
  # resource path
  local_var_path = "/bot{token}/deleteChatPhoto".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#delete_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (String)


91
92
93
94
# File 'lib/teleswagger/api/chats_api.rb', line 91

def export_chat_invite_link(token, chat_id, opts = {})
  data, _status_code, _headers = export_chat_invite_link_with_http_info(token, chat_id, opts)
  return data
end

Returns String data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(String, Fixnum, Hash)>)

    String data, response status code and response headers



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/teleswagger/api/chats_api.rb', line 102

def export_chat_invite_link_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.export_chat_invite_link ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.export_chat_invite_link"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.export_chat_invite_link"
  end
  # resource path
  local_var_path = "/bot{token}/exportChatInviteLink".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#export_chat_invite_link\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chat(token, chat_id, opts = {}) ⇒ InlineResponse2003

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



153
154
155
156
# File 'lib/teleswagger/api/chats_api.rb', line 153

def get_chat(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_with_http_info(token, chat_id, opts)
  return data
end

#get_chat_administrators(token, chat_id, opts = {}) ⇒ InlineResponse2004

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



215
216
217
218
# File 'lib/teleswagger/api/chats_api.rb', line 215

def get_chat_administrators(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_administrators_with_http_info(token, chat_id, opts)
  return data
end

#get_chat_administrators_with_http_info(token, chat_id, opts = {}) ⇒ Array<(InlineResponse2004, Fixnum, Hash)>

Returns InlineResponse2004 data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2004, Fixnum, Hash)>)

    InlineResponse2004 data, response status code and response headers



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/teleswagger/api/chats_api.rb', line 226

def get_chat_administrators_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_administrators ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_administrators"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_administrators"
  end
  # resource path
  local_var_path = "/bot{token}/getChatAdministrators".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2004')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_administrators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chat_member(token, chat_id, user_id, opts = {}) ⇒ InlineResponse2006

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



278
279
280
281
# File 'lib/teleswagger/api/chats_api.rb', line 278

def get_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = get_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end

#get_chat_member_with_http_info(token, chat_id, user_id, opts = {}) ⇒ Array<(InlineResponse2006, Fixnum, Hash)>

Returns InlineResponse2006 data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2006, Fixnum, Hash)>)

    InlineResponse2006 data, response status code and response headers



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/teleswagger/api/chats_api.rb', line 290

def get_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_member ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_member"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_member"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.get_chat_member"
  end
  # resource path
  local_var_path = "/bot{token}/getChatMember".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2006')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chat_members_count(token, chat_id, opts = {}) ⇒ InlineResponse2005

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



346
347
348
349
# File 'lib/teleswagger/api/chats_api.rb', line 346

def get_chat_members_count(token, chat_id, opts = {})
  data, _status_code, _headers = get_chat_members_count_with_http_info(token, chat_id, opts)
  return data
end

#get_chat_members_count_with_http_info(token, chat_id, opts = {}) ⇒ Array<(InlineResponse2005, Fixnum, Hash)>

Returns InlineResponse2005 data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2005, Fixnum, Hash)>)

    InlineResponse2005 data, response status code and response headers



357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/teleswagger/api/chats_api.rb', line 357

def get_chat_members_count_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat_members_count ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat_members_count"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat_members_count"
  end
  # resource path
  local_var_path = "/bot{token}/getChatMembersCount".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2005')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat_members_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_chat_with_http_info(token, chat_id, opts = {}) ⇒ Array<(InlineResponse2003, Fixnum, Hash)>

Returns InlineResponse2003 data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse2003, Fixnum, Hash)>)

    InlineResponse2003 data, response status code and response headers



164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/teleswagger/api/chats_api.rb', line 164

def get_chat_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.get_chat ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.get_chat"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.get_chat"
  end
  # resource path
  local_var_path = "/bot{token}/getChat".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2003')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#get_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#kick_chat_member(token, chat_id, user_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :until_date (Integer)

Returns:



410
411
412
413
# File 'lib/teleswagger/api/chats_api.rb', line 410

def kick_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = kick_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end

#kick_chat_member_with_http_info(token, chat_id, user_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :until_date (Integer)

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
# File 'lib/teleswagger/api/chats_api.rb', line 423

def kick_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.kick_chat_member ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.kick_chat_member"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.kick_chat_member"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.kick_chat_member"
  end
  # resource path
  local_var_path = "/bot{token}/kickChatMember".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id
  query_params[:'until_date'] = opts[:'until_date'] if !opts[:'until_date'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#kick_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#leave_chat(token, chat_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



480
481
482
483
# File 'lib/teleswagger/api/chats_api.rb', line 480

def leave_chat(token, chat_id, opts = {})
  data, _status_code, _headers = leave_chat_with_http_info(token, chat_id, opts)
  return data
end

#leave_chat_with_http_info(token, chat_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'lib/teleswagger/api/chats_api.rb', line 491

def leave_chat_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.leave_chat ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.leave_chat"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.leave_chat"
  end
  # resource path
  local_var_path = "/bot{token}/leaveChat".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#leave_chat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pin_chat_message(token, chat_id, message_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • message_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :disable_notification (BOOLEAN)

Returns:



544
545
546
547
# File 'lib/teleswagger/api/chats_api.rb', line 544

def pin_chat_message(token, chat_id, message_id, opts = {})
  data, _status_code, _headers = pin_chat_message_with_http_info(token, chat_id, message_id, opts)
  return data
end

#pin_chat_message_with_http_info(token, chat_id, message_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • message_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :disable_notification (BOOLEAN)

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
# File 'lib/teleswagger/api/chats_api.rb', line 557

def pin_chat_message_with_http_info(token, chat_id, message_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.pin_chat_message ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.pin_chat_message"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.pin_chat_message"
  end
  # verify the required parameter 'message_id' is set
  if @api_client.config.client_side_validation && message_id.nil?
    fail ArgumentError, "Missing the required parameter 'message_id' when calling ChatsApi.pin_chat_message"
  end
  # resource path
  local_var_path = "/bot{token}/pinChatMessage".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'message_id'] = message_id
  query_params[:'disable_notification'] = opts[:'disable_notification'] if !opts[:'disable_notification'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#pin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#promote_chat_member(token, body, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



614
615
616
617
# File 'lib/teleswagger/api/chats_api.rb', line 614

def promote_chat_member(token, body, opts = {})
  data, _status_code, _headers = promote_chat_member_with_http_info(token, body, opts)
  return data
end

#promote_chat_member_with_http_info(token, body, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/teleswagger/api/chats_api.rb', line 625

def promote_chat_member_with_http_info(token, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.promote_chat_member ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.promote_chat_member"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.promote_chat_member"
  end
  # resource path
  local_var_path = "/bot{token}/promoteChatMember".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#promote_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#restrict_chat_member(token, body, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



675
676
677
678
# File 'lib/teleswagger/api/chats_api.rb', line 675

def restrict_chat_member(token, body, opts = {})
  data, _status_code, _headers = restrict_chat_member_with_http_info(token, body, opts)
  return data
end

#restrict_chat_member_with_http_info(token, body, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • body
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
# File 'lib/teleswagger/api/chats_api.rb', line 686

def restrict_chat_member_with_http_info(token, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.restrict_chat_member ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.restrict_chat_member"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling ChatsApi.restrict_chat_member"
  end
  # resource path
  local_var_path = "/bot{token}/restrictChatMember".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#restrict_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#send_chat_action(token, chat_id, action, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • action
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



737
738
739
740
# File 'lib/teleswagger/api/chats_api.rb', line 737

def send_chat_action(token, chat_id, action, opts = {})
  data, _status_code, _headers = send_chat_action_with_http_info(token, chat_id, action, opts)
  return data
end

#send_chat_action_with_http_info(token, chat_id, action, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • action
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
# File 'lib/teleswagger/api/chats_api.rb', line 749

def send_chat_action_with_http_info(token, chat_id, action, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.send_chat_action ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.send_chat_action"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.send_chat_action"
  end
  # verify the required parameter 'action' is set
  if @api_client.config.client_side_validation && action.nil?
    fail ArgumentError, "Missing the required parameter 'action' when calling ChatsApi.send_chat_action"
  end
  # verify enum value
  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)
    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"
  end
  # resource path
  local_var_path = "/bot{token}/sendChatAction".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'action'] = action

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#send_chat_action\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_chat_description(token, chat_id, description, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • description
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



810
811
812
813
# File 'lib/teleswagger/api/chats_api.rb', line 810

def set_chat_description(token, chat_id, description, opts = {})
  data, _status_code, _headers = set_chat_description_with_http_info(token, chat_id, description, opts)
  return data
end

#set_chat_description_with_http_info(token, chat_id, description, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • description
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
# File 'lib/teleswagger/api/chats_api.rb', line 822

def set_chat_description_with_http_info(token, chat_id, description, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_description ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_description"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_description"
  end
  # verify the required parameter 'description' is set
  if @api_client.config.client_side_validation && description.nil?
    fail ArgumentError, "Missing the required parameter 'description' when calling ChatsApi.set_chat_description"
  end
  # resource path
  local_var_path = "/bot{token}/setChatDescription".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'description'] = description

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_description\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_chat_photo(token, chat_id, photo, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • photo
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



879
880
881
882
# File 'lib/teleswagger/api/chats_api.rb', line 879

def set_chat_photo(token, chat_id, photo, opts = {})
  data, _status_code, _headers = set_chat_photo_with_http_info(token, chat_id, photo, opts)
  return data
end

#set_chat_photo_with_http_info(token, chat_id, photo, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • photo
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
# File 'lib/teleswagger/api/chats_api.rb', line 891

def set_chat_photo_with_http_info(token, chat_id, photo, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_photo ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_photo"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_photo"
  end
  # verify the required parameter 'photo' is set
  if @api_client.config.client_side_validation && photo.nil?
    fail ArgumentError, "Missing the required parameter 'photo' when calling ChatsApi.set_chat_photo"
  end
  # resource path
  local_var_path = "/bot{token}/setChatPhoto".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])

  # form parameters
  form_params = {}
  form_params["chat_id"] = chat_id
  form_params["photo"] = photo

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_photo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_chat_title(token, chat_id, title, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • title
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



948
949
950
951
# File 'lib/teleswagger/api/chats_api.rb', line 948

def set_chat_title(token, chat_id, title, opts = {})
  data, _status_code, _headers = set_chat_title_with_http_info(token, chat_id, title, opts)
  return data
end

#set_chat_title_with_http_info(token, chat_id, title, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • title
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
# File 'lib/teleswagger/api/chats_api.rb', line 960

def set_chat_title_with_http_info(token, chat_id, title, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.set_chat_title ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.set_chat_title"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.set_chat_title"
  end
  # verify the required parameter 'title' is set
  if @api_client.config.client_side_validation && title.nil?
    fail ArgumentError, "Missing the required parameter 'title' when calling ChatsApi.set_chat_title"
  end
  # resource path
  local_var_path = "/bot{token}/setChatTitle".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'title'] = title

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#set_chat_title\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unban_chat_member(token, chat_id, user_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1017
1018
1019
1020
# File 'lib/teleswagger/api/chats_api.rb', line 1017

def unban_chat_member(token, chat_id, user_id, opts = {})
  data, _status_code, _headers = unban_chat_member_with_http_info(token, chat_id, user_id, opts)
  return data
end

#unban_chat_member_with_http_info(token, chat_id, user_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • user_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
# File 'lib/teleswagger/api/chats_api.rb', line 1029

def unban_chat_member_with_http_info(token, chat_id, user_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.unban_chat_member ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unban_chat_member"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unban_chat_member"
  end
  # verify the required parameter 'user_id' is set
  if @api_client.config.client_side_validation && user_id.nil?
    fail ArgumentError, "Missing the required parameter 'user_id' when calling ChatsApi.unban_chat_member"
  end
  # resource path
  local_var_path = "/bot{token}/unbanChatMember".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id
  query_params[:'user_id'] = user_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#unban_chat_member\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unpin_chat_message(token, chat_id, opts = {}) ⇒ ResponseBool

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1085
1086
1087
1088
# File 'lib/teleswagger/api/chats_api.rb', line 1085

def unpin_chat_message(token, chat_id, opts = {})
  data, _status_code, _headers = unpin_chat_message_with_http_info(token, chat_id, opts)
  return data
end

#unpin_chat_message_with_http_info(token, chat_id, opts = {}) ⇒ Array<(ResponseBool, Fixnum, Hash)>

Returns ResponseBool data, response status code and response headers.

Parameters:

  • token

    bot&#39;s token to authorize the request

  • chat_id
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResponseBool, Fixnum, Hash)>)

    ResponseBool data, response status code and response headers



1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
# File 'lib/teleswagger/api/chats_api.rb', line 1096

def unpin_chat_message_with_http_info(token, chat_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ChatsApi.unpin_chat_message ..."
  end
  # verify the required parameter 'token' is set
  if @api_client.config.client_side_validation && token.nil?
    fail ArgumentError, "Missing the required parameter 'token' when calling ChatsApi.unpin_chat_message"
  end
  # verify the required parameter 'chat_id' is set
  if @api_client.config.client_side_validation && chat_id.nil?
    fail ArgumentError, "Missing the required parameter 'chat_id' when calling ChatsApi.unpin_chat_message"
  end
  # resource path
  local_var_path = "/bot{token}/unpinChatMessage".sub('{' + 'token' + '}', token.to_s)

  # query parameters
  query_params = {}
  query_params[:'chat_id'] = chat_id

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ResponseBool')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ChatsApi#unpin_chat_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end