module RabbotMetaBotgroupReport
Constants
- IRC_TAG
- STYLE_TITLE
Public Instance Methods
Source
# File lib/rabbot_meta_botgroup_report.rb, line 54 def format_action(message) IrcReply.card( tag: IRC_TAG, title: "Bot group", body_lines: [message.to_s.strip], footer_parts: ["BotMesh"], heading_style: STYLE_TITLE ) end
Source
# File lib/rabbot_meta_botgroup_report.rb, line 21 def format_list(groups:, network:, channel:) body = if groups.empty? ["No bot groups in #{channel} on #{network}."] else groups.map do |group| kind = group[:implicit] ? "owner" : "custom" "#{group[:name]} (#{kind}) — #{group[:owner_user]}" end end IrcReply.card( tag: IRC_TAG, title: "Bot groups — #{channel}", body_lines: body, footer_parts: [network.to_s, "#{groups.length} groups"], heading_style: STYLE_TITLE ) end
Source
# File lib/rabbot_meta_botgroup_report.rb, line 39 def format_members(group:, members:) body = if members.empty? ["No bots in #{group[:name]}."] else members.map { |bot_id| bot_id.to_s } end IrcReply.card( tag: IRC_TAG, title: "Group — #{group[:name]}", body_lines: body, footer_parts: [group[:channel].to_s, "#{members.length} bots"], heading_style: STYLE_TITLE ) end
Source
# File lib/rabbot_meta_botgroup_report.rb, line 64 def format_postgres_help(extensions: BotMesh.recommended_plugins) body = BotMesh.postgresql_setup_notes + ["Recommended extensions: #{extensions.join(", ")}"] IrcReply.card( tag: IRC_TAG, title: "PostgreSQL setup", body_lines: body, footer_parts: ["RabbotDb", "BotMesh"], heading_style: STYLE_TITLE ) end
Source
# File lib/rabbot_meta_botgroup_report.rb, line 17 def format_usage "Usage: !rabbot botgroup [list|add <group> <bot>|rem <group> <bot>|postgres]" end