Class: WorkWechatBot

Inherits:
LogRecordBot show all
Defined in:
app/models/concerns/work_wechat_bot.rb

Instance Attribute Summary

Attributes inherited from LogRecordBot

#content

Instance Method Summary collapse

Methods inherited from LogRecordBot

#add_column, #add_paragraph, #add_section, #initialize, #link_more, #set_content

Constructor Details

This class inherits a constructor from LogRecordBot

Instance Method Details

#bodyObject



9
10
11
12
13
14
15
16
# File 'app/models/concerns/work_wechat_bot.rb', line 9

def body
  {
    msgtype: 'markdown',
    markdown: {
      content: content
    }
  }
end

#send_messageObject



3
4
5
6
7
# File 'app/models/concerns/work_wechat_bot.rb', line 3

def send_message
  url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=#{RailsCom.config.notify_key}"

  HTTPX.post(url, json: body)
end