summaryrefslogtreecommitdiff
path: root/src/api/bot/interfaces
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-10-07 06:03:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-10-07 06:03:16 +0900
commitf5fe36825b0c83d8770e0f3cdf5c2d477eb2b995 (patch)
treeac78f0e056c7a316975d5e196d4a28ce30235eaf /src/api/bot/interfaces
parent:v: (diff)
downloadsharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.tar.gz
sharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.tar.bz2
sharkey-f5fe36825b0c83d8770e0f3cdf5c2d477eb2b995.zip
:v:
Diffstat (limited to 'src/api/bot/interfaces')
-rw-r--r--src/api/bot/interfaces/line.ts20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/api/bot/interfaces/line.ts b/src/api/bot/interfaces/line.ts
index 61aa728121..52559eaeff 100644
--- a/src/api/bot/interfaces/line.ts
+++ b/src/api/bot/interfaces/line.ts
@@ -32,20 +32,16 @@ module.exports = async (app: express.Application) => {
}
});
- if (user) {
- session = new BotCore(user);
- } else {
- session = new BotCore();
- session.on('set-user', user => {
- User.update(user._id, {
- $set: {
- line: {
- user_id: sourceId
- }
+ session = new BotCore(user);
+ session.on('set-user', user => {
+ User.update(user._id, {
+ $set: {
+ line: {
+ user_id: sourceId
}
- });
+ }
});
- }
+ });
redis.set(sessionId, JSON.stringify(session.export()));
} else {