Module: Viberroo::Message

Included in:
Bot
Defined in:
lib/viberroo/message.rb

Instance Method Summary collapse

Instance Method Details

#send_contact(params = {}) ⇒ Object



30
31
32
# File 'lib/viberroo/message.rb', line 30

def send_contact(params = {})
  dispatch({ type: :contact }.merge(params))
end

#send_file(params = {}) ⇒ Object



26
27
28
# File 'lib/viberroo/message.rb', line 26

def send_file(params = {})
  dispatch({ type: :file }.merge(params))
end

#send_location(params = {}) ⇒ Object



14
15
16
# File 'lib/viberroo/message.rb', line 14

def send_location(params = {})
  dispatch({ type: :location, min_api_version: 3 }.merge(params))
end

#send_message(params = {}) ⇒ Object

TODO: add list of params that is mandatory for particular message type, throw exceptions and log errors if not found



6
7
8
# File 'lib/viberroo/message.rb', line 6

def send_message(params = {})
  dispatch({ type: :text }.merge(params))
end

#send_picture(params = {}) ⇒ Object



18
19
20
# File 'lib/viberroo/message.rb', line 18

def send_picture(params = {})
  dispatch({ type: :picture }.merge(params))
end

#send_rich_media(params = {}) ⇒ Object



10
11
12
# File 'lib/viberroo/message.rb', line 10

def send_rich_media(params = {})
  dispatch({ type: :rich_media, min_api_version: 2 }.merge(params))
end

#send_sticker(params = {}) ⇒ Object



39
40
41
# File 'lib/viberroo/message.rb', line 39

def send_sticker(params = {})
  dispatch({ type: :sticker }.merge(params))
end

#send_url(params = {}) ⇒ Object



34
35
36
# File 'lib/viberroo/message.rb', line 34

def send_url(params = {})
  dispatch({ type: :url }.merge(params))
end

#send_video(params = {}) ⇒ Object



22
23
24
# File 'lib/viberroo/message.rb', line 22

def send_video(params = {})
  dispatch({ type: :video }.merge(params))
end