diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 06:03:16 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-10-07 06:03:16 +0900 |
| commit | f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995 (patch) | |
| tree | ac78f0e056c7a316975d5e196d4a28ce30235eaf /src/api/bot/core.ts | |
| parent | :v: (diff) | |
| download | sharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.tar.gz sharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.tar.bz2 sharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.zip | |
:v:
Diffstat (limited to 'src/api/bot/core.ts')
| -rw-r--r-- | src/api/bot/core.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index 1f624c5f0a..4109519ca5 100644 --- a/src/api/bot/core.ts +++ b/src/api/bot/core.ts @@ -34,7 +34,7 @@ export default class BotCore extends EventEmitter { public static import(data) { const core = new BotCore(); - core.user = data.user; + core.user = data.user ? data.user : null; core.setContect(data.context ? Context.import(core, data.context) : null); return core; } @@ -84,7 +84,7 @@ abstract class Context extends EventEmitter { } class SigninContext extends Context { - private temporaryUser: IUser; + private temporaryUser: IUser = null; public async greet(): Promise<string> { return 'まずユーザー名を教えてください:'; @@ -124,6 +124,7 @@ class SigninContext extends Context { public export() { return { + type: 'signin', temporaryUser: this.temporaryUser }; } |