Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(thought-process): Add incoming stages and interfaces
- Add thought process tests - Update thought process docs - Start Hubot migration docs - Add .unloadListeners to clear listeners - Clear listeners on bot reset
- Loading branch information
1 parent
3a9dd93
commit bd98c0d
Showing
11 changed files
with
301 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
[thought]: ./ThoughtProcess.md | ||
|
||
Requiring/importing the bot... | ||
|
||
Async all the things | ||
|
||
Logging and error handling | ||
|
||
Coffee -> ES2015 -> Typescript | ||
|
||
^^^ | ||
|
||
## Hearing and Listening | ||
|
||
`listen`, `hear` and `respond` methods have counterparts within bBot but they | ||
work slightly differently and we've attempted to find more semantic naming. | ||
|
||
### Hear ➡️ ListenText | ||
- In **Hubot** `hear` adds a text pattern listener. | ||
- In **bBot** `listenText` does the same, where `hear` is the [process][thought] | ||
which determines if incoming messages will be given to listeners. | ||
|
||
### Respond ➡️ ListenDirect | ||
- In **Hubot** `respond` add a text pattern listener that will only match if | ||
prefixed with the bot's name. | ||
- In **bBot** `listenDirect` does the same. | ||
|
||
### Listen ➡️ ListenCustom | ||
- In **Hubot** `listen` is a sort of abstract for both `hear` and `respond`. | ||
- In **bBot** `listen` is the [process][thought] which provides messages to each | ||
listener. `listenCustom` can be used to create a listener with a custom matching | ||
function. | ||
|
||
### Example | ||
|
||
Hubot | ||
```js | ||
module.exports = (robot) => robot.hear(/.*/, () => console.log('I hear!')) | ||
``` | ||
|
||
bBot | ||
```js | ||
export default (bot) => bot.listenText(/.*/, () => console.log('I listen!')) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.