Skip to content

Commit

Permalink
fix helps
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-exz committed Dec 23, 2024
1 parent f218cc6 commit e093f01
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 19 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## 0.18.3
### Bugfixes
- Reminder fixes
- Help documentation fixes

## 0.18.2
### Bugfixes
- Fixing version display in help
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/action_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ActionCreate
DESCRIPTION = 'Will create an answer from the bot for this keyword problem.'.freeze
EXAMPLE = 'Usage: `action create problem:NEWERROR action:What to do with this error`'.freeze
EXAMPLE = '`action create problem:<substring> action:<what to do if substring found>` example: `action create problem:NEWERROR action:What to do with this error`'.freeze
def self.call(client:, data:, match:)
action = Action.new(
problem: match['expression'][/problem:(.*) action:/, 1],
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/action_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ActionDelete
DESCRIPTION = 'Will delete the answer from the bot for this keyword.'.freeze
EXAMPLE = 'Usage: `action delete problem:NEWERROR`'.freeze
EXAMPLE = '`action delete problem:<exact substring>` example: `action delete problem:NEWERROR`'.freeze
def self.call(client:, data:, match:)
Action.where(
problem: match['expression'][/problem:(.*)/, 1],
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/action_show_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ActionShowAction
DESCRIPTION = 'Will display action for mentioned problem'.freeze
EXAMPLE = 'Usage: `action show action for problem:MyProblem`'.freeze
EXAMPLE = '`action show action for problem:<exact substring>` example: `action show action for problem:MyProblem`'.freeze
def self.call(client:, data:, match:)
problem_text = match['expression'][/problem:(.*)$/, 1]
problems = Action.where('channel = ? AND problem LIKE ?', data.channel, "%#{problem_text}%")
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/action_show_problems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ActionShowProblems
DESCRIPTION = 'Will display problems for this channel'.freeze
EXAMPLE = 'Usage: `action show problems`'.freeze
EXAMPLE = '`action show problems`'.freeze
def self.call(client:, data:)
problems = Action.where(channel: data.channel).where.not(action: nil)

Expand Down
2 changes: 1 addition & 1 deletion bot/commands/answer_delete_custom_text.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module WhoIsOnDutyTodaySlackBotModule
module Commands
class AnswerDeleteCustomText
DESCRIPTION = 'Will delete the custom text answer and use the default.'.freeze
DESCRIPTION = 'Will delete all custom text in channel.'.freeze
EXAMPLE = 'Usage: `answer delete custom text`'.freeze
def self.call(client:, data:)
Answer.where(channel_id: data.channel).delete_all
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/answer_disable_hide_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class AnswerDisableHideReason

DESCRIPTION = 'Will show the reason like `You asked at a non-working day.`'.freeze
EXAMPLE = 'Usage: `answer disable hide reason`'.freeze
EXAMPLE = '`answer disable hide reason`'.freeze
def self.call(client:, data:)
Answer.where(channel_id: data.channel).update_all(hide_reason: false)
client.web_client.chat_postMessage(
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/answer_enable_hide_reason.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class AnswerEnableHideReason
DESCRIPTION = 'Will hide the reason like `You asked at a non-working day.`Only your custom text will be displayed.'.freeze
EXAMPLE = 'Usage: `answer enable hide reason`'.freeze
EXAMPLE = '`answer enable hide reason`'.freeze
def self.call(client:, data:)
if Answer.where(channel_id: data.channel).update_all(hide_reason: true)
client.web_client.chat_postMessage(
Expand Down
4 changes: 2 additions & 2 deletions bot/commands/answer_set_custom_text.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module WhoIsOnDutyTodaySlackBotModule
module Commands
class AnswerSetCustomText
DESCRIPTION = 'Will configure custom text in answers from the bot. type:non_working_time/working_time'.freeze
EXAMPLE = 'Usage: `cibot answer set custom text type:non_working_time text:This is the custom text for non working hours.`'.freeze
DESCRIPTION = 'Will configure default answer in channel. type:non_working_time/working_time'.freeze
EXAMPLE = '`cibot answer set custom text type:<time type> text:<custom text>` example: `cibot answer set custom text type:non_working_time text:This is the custom text for non working hours.`'.freeze
def self.call(client:, data:, match:)
expression = match['expression']

Expand Down
4 changes: 2 additions & 2 deletions bot/commands/duty_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class DutyDelete

DESCRIPTION = 'Will delete a duty.'.freeze
EXAMPLE = 'Usage: `duty delete`'.freeze
DESCRIPTION = 'Will delete a duty in channel where you write it.'.freeze
EXAMPLE = '`duty delete`'.freeze
def self.call(client:, data:)
duty = Duty.where(user_id: data.user, channel_id: data.channel).first
if duty.blank?
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/duty_set_opsgenie_escalation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class DutySetOpsgenieEscalation
DESCRIPTION = 'Will configure all duties in the channel with the escalation name from Opsgenie.'.freeze
EXAMPLE = 'Usage: `duty set opsgenie escalation My_Team_Escalation`'.freeze
EXAMPLE = '`duty set opsgenie escalation <escalation name>` example: `duty set opsgenie escalation My_Team_Escalation`'.freeze
def self.call(client:, data:, match:)
opsgenie_escalation_name = match['expression']
Duty.where(channel_id: data.channel).update_all(opsgenie_escalation_name: opsgenie_escalation_name)
Expand Down
4 changes: 2 additions & 2 deletions bot/commands/duty_sync_with_opsgenie_schedule.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module WhoIsOnDutyTodaySlackBotModule
module Commands
class DutySyncWithOpsgenieSchedule
DESCRIPTION = 'Will configure all duties in the channel with the schedule name from Opsgenie.'.freeze
EXAMPLE = 'Usage: `duty sync with opsgenie schedule My_Team_Schedule`'.freeze
DESCRIPTION = 'Duty person will be taken from Opsgenie when his shift comes, rotation happen each 5 min.'.freeze
EXAMPLE = '`duty sync with opsgenie schedule <schedule name>` example: `duty sync with opsgenie schedule My_Team_Schedule`'.freeze
def self.call(client:, data:, match:)
opsgenie_schedule_name = match['expression']
Duty.where(channel_id: data.channel).update_all(opsgenie_schedule_name: opsgenie_schedule_name)
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/duty_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class DutyUpdate
DESCRIPTION = 'Will update a duty. Time should be defined in your local timezone.'.freeze
EXAMPLE = 'Usage: `duty update from 8:00 to 17:00`'.freeze
EXAMPLE = '`duty update from <from time> to <to time>` example: `duty update from 8:00 to 17:00`'.freeze
def self.call(client:, data:, match:)
duty = Duty.where(user_id: data.user, channel_id: data.channel).first

Expand Down
2 changes: 1 addition & 1 deletion bot/commands/git_commits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Commands
class UserCommits

DESCRIPTION = 'Will display the last 10 commits of a user.'.freeze
EXAMPLE = 'Usage: `git commits @user`'.freeze
EXAMPLE = '`git commits <user>` example: `git commits @user`'.freeze
def self.call(client:, data:, match:)
message_processor = MessageProcessor.new
user_name = match['expression'][/<@(.+)>/, 1]
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def self.generate_help_text
AnswerSetCustomText,
AnswerDeleteCustomText,
AnswerEnableHideReason,
AnswerEnableHideReason,
AnswerDisableHideReason,
ActionCreate,
ActionDelete,
ActionShowProblems,
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/thread_labels.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ThreadLabels
DESCRIPTION = 'Will label the thread with any label. Use space as a separator.'.freeze
EXAMPLE = 'Usage: `thread labels label1 label2`'.freeze
EXAMPLE = '`thread labels <label>` example: `thread labels label1 label2`'.freeze
def self.call(client:, data:, match:)
label_ids = []
match['expression'].split.each do |label|
Expand Down
2 changes: 1 addition & 1 deletion bot/commands/thread_labels_clean.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module WhoIsOnDutyTodaySlackBotModule
module Commands
class ThreadLabelsClean
DESCRIPTION = 'Will remove all labels from the thread where you write it.'.freeze
EXAMPLE = 'Usage: `thread labels clean`'.freeze
EXAMPLE = '`thread labels clean`'.freeze
def self.call(client:, data:, match:)
SlackThread.find_by(thread_ts: data.thread_ts).destroy
client.web_client.chat_postMessage(
Expand Down

0 comments on commit e093f01

Please sign in to comment.