https://github.com/intrepidpursuits/kevinbot
https://github.com/intrepidpursuits/kevinbot
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/intrepidpursuits/kevinbot
- Owner: IntrepidPursuits
- Created: 2014-05-08T12:53:17.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2019-05-21T16:41:02.000Z (about 7 years ago)
- Last Synced: 2025-02-03T14:46:20.967Z (over 1 year ago)
- Language: Ruby
- Homepage: http://intrepid.io
- Size: 70.3 KB
- Stars: 0
- Watchers: 53
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kevinbot 2.0
This is kevinbot. He is the chatbot at Intrepid.
## Start
`ruby kevinbot.rb`
## Make a new command
### Create a new class named the same as your command inheriting from `BaseCommand`. For example, if your command is `/mycoolcommand`:
###### commands/mycoolcommand.rb
```ruby
class Mycoolcommand < BaseCommand
#...
end
```
### Craft your response to Slack in the `perform` method:
###### commands/mycoolcommand.rb
```ruby
class Mycoolcommand < BaseCommand
def perform
text = 'Look how cool this is'
end
end
```
### Send it back to Slack with the `respond` method:
###### commands/mycoolcommand.rb
```ruby
class Mycoolcommand < BaseCommand
def perform
text = 'Look how cool this is'
respond(text)
end
end
```
### Make a new slash command on [Slack](https://intrepid.slack.com/services/new/slash-commands) with these settings:
| Field | Value |
|:--------|:-----------------------------------|
| Command | `/rave` |
| URL | `https://kevinbot2.herokuapp.com/` |
| Method | **POST** |