Class: FeishuBot

Inherits:
LogRecordBot show all
Defined in:
app/models/concerns/feishu_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



8
9
10
11
12
13
# File 'app/models/concerns/feishu_bot.rb', line 8

def body
  {
    title: '收到错误通知',
    text: content
  }
end

#send_messageObject



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

def send_message
  url = "https://open.feishu.cn/open-apis/bot/hook/#{RailsCom.config.notify_key}"
  HTTPX.post(url, json: body)
end