Skip to content

Commit

Permalink
methods not variables
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanxu committed Mar 24, 2021
1 parent 969ef50 commit a74c980
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions docs/custom_responder.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ClockResponder < Responder
end
```

When initialized, a responder will have available the name of the bot in the `@bot_name` instance variable and all the parameters for the responder from the config file in the `@params` instance variable.
When initialized, a responder will have accessor methods for the name of the bot (`bot_name`) and for the parameters of the responder coming from the config file (`params`).

### Keyname

Expand Down Expand Up @@ -79,7 +79,7 @@ class ClockResponder < Responder

def define_listening
@event_action = "issue_comment.created"
@event_regex = /\A@#{@bot_name} what time is it\?\s*\z/i
@event_regex = /\A@#{bot_name} what time is it\?\s*\z/i
end
end
```
Expand All @@ -98,7 +98,7 @@ class ClockResponder < Responder
required_params :command

@event_action = "issue_comment.created"
@event_regex = /\A@#{@bot_name} #{command}\s*\z/i
@event_regex = /\A@#{bot_name} #{command}\s*\z/i
end
end
```
Expand All @@ -121,7 +121,7 @@ class ClockResponder < Responder
def define_listening
@event_action = "issue_comment.created"
@event_regex = /\A@#{@bot_name} #{clock_command}\s*\z/i
@event_regex = /\A@#{bot_name} #{clock_command}\s*\z/i
end
def clock_command
Expand All @@ -131,4 +131,8 @@ end
```


### Process message




0 comments on commit a74c980

Please sign in to comment.