-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
367b682
commit df042e1
Showing
9 changed files
with
5,157 additions
and
4,950 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
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 |
---|---|---|
|
@@ -3,4 +3,6 @@ export default { | |
|
||
// 自动同意添加好友的口令 | ||
acceptText: /芝麻开门/, | ||
|
||
logger: true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export function echo (text: string) { | ||
export function handle (text: string) { | ||
return text | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { Sayable } from 'wechaty'; | ||
import { echo } from './echo'; | ||
import { Message, Sayable } from 'wechaty' | ||
import * as echo from './echo' | ||
import * as fund from './fund' | ||
|
||
type Route = { | ||
keyword: string | RegExp; | ||
handle: ((text: string) => Sayable) | ((text: string) => Promise<Sayable>); | ||
handle: ((text: string) => Sayable) | ((text: string) => Promise<Sayable>) | ||
keyword: string | RegExp | ||
filter?: (msg: Message) => boolean | ||
} | ||
|
||
export const routes: Route[] = [ | ||
{ keyword: '', handle: echo }, | ||
{ keyword: '基金', handle: fund.topFund }, | ||
] | ||
{ | ||
keyword: '/ping', | ||
handle() { | ||
return 'pong' | ||
}, | ||
}, | ||
{ keyword: '基金', handle: fund.handle }, | ||
{ keyword: '', handle: echo.handle }, | ||
] |
Oops, something went wrong.