Method: WeChat::Bot::Client#send

Defined in:
lib/wechat/bot/client.rb

#send(type, username, content) ⇒ Hash<Object,Object>

消息发送

Parameters:

  • type (Symbol)

    消息类型,未知类型默认走 :text

    • :text 文本

    • :emoticon 表情

    • :image 图片

  • username (String)
  • content (String)

Returns:

  • (Hash<Object,Object>)

    发送结果状态



338
339
340
341
342
343
344
345
346
347
# File 'lib/wechat/bot/client.rb', line 338

def send(type, username, content)
  case type
  when :emoticon
    send_emoticon(username, content)
  when :image
    send_image(username, content: content)
  else
    send_text(username, content)
  end
end