Method: Banacle::SlashCommand::Renderer#render_approval_request

Defined in:
lib/banacle/slash_command/renderer.rb

#render_approval_requestObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/banacle/slash_command/renderer.rb', line 21

def render_approval_request
  text = "<@\#{user_id}> wants to *\#{command.action} NACL DENY entry* under the following conditions:\n```\n\#{JSON.pretty_generate(command.to_h)}\n```\n  EOS\n\n  Slack::Response.new(\n    response_type: \"in_channel\",\n    text: text,\n    attachments: [\n      Slack::Attachment.new(\n        text: config.dig(:approval_request, :attachment, :text) || \"*Approval Request*\",\n        fallback: \"TBD\",\n        callback_id: \"banacle_approval_request\",\n        color: \"#3AA3E3\",\n        attachment_type: \"default\",\n        actions: [\n          Slack::Action.approve_button,\n          Slack::Action.reject_button,\n          Slack::Action.cancel_button,\n        ]\n      ),\n    ],\n  ).to_json\nend\n"