Class: Moceansdk::Modules::Command::McObject::TgSendAnimation

Inherits:
AbstractMc
  • Object
show all
Defined in:
lib/moceansdk/modules/command/mc_object/tg_send_animation.rb

Instance Method Summary collapse

Methods inherited from AbstractMc

#get_request_data, #initialize

Constructor Details

This class inherits a constructor from Moceansdk::Modules::Command::McObject::AbstractMc

Instance Method Details

#actionObject



7
8
9
# File 'lib/moceansdk/modules/command/mc_object/tg_send_animation.rb', line 7

def action
  'send-telegram'
end

#content(url, text) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/moceansdk/modules/command/mc_object/tg_send_animation.rb', line 29

def content(url,text)
  @params[:'content'] = {}
  @params[:'content'][:'rich_media_url'] = url
  @params[:'content'][:'text'] = text
  @params[:'content'][:'type'] = 'animation'
  return self
end

#from(from, contact_type = 'bot_username') ⇒ Object



15
16
17
18
19
20
# File 'lib/moceansdk/modules/command/mc_object/tg_send_animation.rb', line 15

def from(from, contact_type = 'bot_username')
  @params[:'from'] = {}
  @params[:'from'][:'id'] = from
  @params[:'from'][:'type'] = contact_type
  return self
end

#required_keyObject



11
12
13
# File 'lib/moceansdk/modules/command/mc_object/tg_send_animation.rb', line 11

def required_key
  ['from','to','content']
end

#to(to, contact_type = "chat_id") ⇒ Object



22
23
24
25
26
27
# File 'lib/moceansdk/modules/command/mc_object/tg_send_animation.rb', line 22

def to(to, contact_type = "chat_id")
  @params[:'to'] = {}
  @params[:'to'][:'id'] = to
  @params[:'to'][:'type'] = contact_type
  return self
end