Skip to content

Commit

Permalink
help fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-exz committed Dec 23, 2024
1 parent e210158 commit 194e078
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bot/commands/call_duty_person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class CallDutyPerson

DESCRIPTION = 'Will send an alert message to the duty person.'.freeze
EXAMPLE = 'Usage: `call duty person`'.freeze
EXAMPLE = '`call duty person`'.freeze
def self.call(client:, data:)
duty = Duty.where(channel_id: data.channel).where(enabled: true).take!
slack_web_client = Slack::Web::Client.new
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_auto_answer_disable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class ChannelAutoAnswerDisable < SlackRubyBot::Commands::Base

DESCRIPTION = 'Bot stop answer on any message in channel at working time'.freeze
EXAMPLE = "Usage: `channel auto answer disable`".freeze
EXAMPLE = '`channel auto answer disable`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(auto_answer_enabled: false)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_auto_answer_enable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class ChannelAutoAnswerEnable < SlackRubyBot::Commands::Base

DESCRIPTION = 'Bot will answer on any message in channel at working time'.freeze
EXAMPLE = 'Usage: `channel auto answer enable`'.freeze
EXAMPLE = '`channel auto answer enable`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(auto_answer_enabled: true)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_labels_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ChannelLabelsList
DESCRIPTION = 'Will display all labels in this channel.'.freeze
EXAMPLE = 'Usage: `channel labels list`'.freeze
EXAMPLE = '`channel labels list`'.freeze
def self.call(client:, data:, match:)
m = SlackThread.joins(:labels).where(channel_id: data.channel).group(:label).count.keys
client.web_client.chat_postMessage(
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_labels_merge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ChannelLabelsMerge
DESCRIPTION = 'Will migrate existing threads in the channel from one label to another.'.freeze
EXAMPLE = 'Usage: `channel labels merge from:label1 to:label2`'.freeze
EXAMPLE = '`channel labels merge from:<label 1> to:<label 2>` example: `channel labels merge from:jenkins_issue to:jenkins_problem`'.freeze
def self.call(client:, data:, match:)
label_from = match['expression'][/from:(.*) to:/, 1]
label_to = match['expression'][/ to:(.*)$/, 1]
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_labels_statistic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ChannelLabelsStatistic
DESCRIPTION = 'Will show the label count in the channel for the last week.'.freeze
EXAMPLE = 'Usage: `channel labels statistic`'.freeze
EXAMPLE = '`channel labels statistic`'.freeze
def self.call(client:, data:, match:)
message = ''
(0..8).to_a.each do |x|;
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_reminder_disabled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class ChannelReminderDisabled

DESCRIPTION = 'Will disable reminders for unanswered messages in the channel.'.freeze
EXAMPLE = 'Usage: `channel reminder disabled`'.freeze
EXAMPLE = '`channel reminder disabled`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(reminder_enabled: false)
Expand Down
4 changes: 2 additions & 2 deletions bot/commands/channel_reminder_enabled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ChannelReminderEnabled

DESCRIPTION = 'Will enable reminders for unanswered messages in the channel.'.freeze
EXAMPLE = 'Usage: `channel reminder enabled`'.freeze
DESCRIPTION = 'Will enable reminders for unanswered messages in the channel. Bot will send links to threads without responses each 15 min to duty person in direct message'.freeze
EXAMPLE = '`channel reminder enabled`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(reminder_enabled: true)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_tag_reporter_in_thread_disable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class ChannelTagReporterInThreadDisable < SlackRubyBot::Commands::Base

DESCRIPTION = 'Bot will not tag the reporter in the thread.'.freeze
EXAMPLE = 'Usage: `channel tag reporter in thread disable`'.freeze
EXAMPLE = '`channel tag reporter in thread disable`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(tag_reporter_enabled: false)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/channel_tag_reporter_in_thread_enable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class ChannelTagReporterInThreadEnable < SlackRubyBot::Commands::Base

DESCRIPTION = 'Bot will tag the reporter in the thread.'.freeze
EXAMPLE = 'Usage: `channel tag reporter in thread enable`'.freeze
EXAMPLE = '`channel tag reporter in thread enable`'.freeze
def self.call(client:, data:)
channel = Channel.find_or_initialize_by(slack_channel_id: data.channel)
channel.update(tag_reporter_enabled: true)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/checked.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class Checked
DESCRIPTION = 'Will mark the thread as checked.'.freeze
EXAMPLE = 'Usage: `checked`'.freeze
EXAMPLE = '`checked`'.freeze
def self.call(client:, data:)
message_processor = MessageProcessor.new
message_processor.disable_message_from_remind(data: data)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/create_duty_for_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class CreateDutyForUser

DESCRIPTION = 'Will create a duty for a user in the channel.'.freeze
EXAMPLE = 'Usage: `duty create for @user from 09:00 to 17:00`'.freeze
EXAMPLE = '`duty create for <user> from <from time> to <to time>` example: `duty create for @user from 09:00 to 17:00`'.freeze
def self.call(client:, data:, match:)
message_processor = MessageProcessor.new
slack_web_client = Slack::Web::Client.new
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class Help
DESCRIPTION = 'Will show the available commands.'.freeze
EXAMPLE = 'Usage: `help`'.freeze
EXAMPLE = '`help`'.freeze

def self.call(client:, data:)
help_text = generate_help_text
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/i_am_on_duty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class IAmOnDuty
DESCRIPTION = 'Will set you as the duty person in the channel.'.freeze
EXAMPLE = 'Usage: `i am on duty`'.freeze
EXAMPLE = '`i am on duty`'.freeze
def self.call(client:, data:)
Duty.where(channel_id: data.channel).where(user_id: data.user).update_all(enabled: true)
Duty.where(channel_id: data.channel).where.not(user_id: data.user).update_all(enabled: false)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/my_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class MyStatus
Will set any status when you cannot provide support in the channels where you are on duty. Bot will reply instead of you.
`my status work` - Bot will stop telling your status. Use it when you come back.
DESC
EXAMPLE = 'Usage: `my status went to lunch`'.freeze
EXAMPLE = '`my status <some words about status>` example: `my status on lunch`'.freeze
def self.call(data:, client:, match:)
status = match['expression']
if status.nil? || status == 'work'
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/who_is_on_duty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class WhoIsOnDuty
DESCRIPTION = 'Will display the name of the duty person.'.freeze
EXAMPLE = 'Usage: `who is on duty?`'.freeze
EXAMPLE = '`who is on duty?`'.freeze
def self.call(client:, data:)
duty = Duty.where(channel_id: data.channel).where(enabled: true).take!
client.say(
Expand Down

0 comments on commit 194e078

Please sign in to comment.