Repository: Yoctol/bottender
Pull request #33 (2017-11-21 14:24:19)

stop passing as_user:true
https://api.slack.com/methods/chat.postMessage#authorship
I think it's mistake that we pass this before. This is for bots to post as a human user.


Patch:
diff --git a/examples/with-botanalytics/README.md b/examples/analytics-botanalytics/README.md
similarity index 68%
rename from examples/with-botanalytics/README.md
rename to examples/analytics-botanalytics/README.md
index b11913cf..e1151cdb 100644
--- a/examples/with-botanalytics/README.md
+++ b/examples/analytics-botanalytics/README.md
@@ -1,12 +1,12 @@
-# With botanalytics
+# Analytics: Botanalytics
 
 ## Install and Run
 
 Download this example or clone [Bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-botanalytics
-cd with-botanalytics
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/analytics-botanalytics
+cd analytics-botanalytics
 npm install
 npm run dev
 ```
@@ -18,7 +18,7 @@ case, we take [botanalytics](https://botanalytics.co/) as an example.
 
 The following code is the main part of this example which demonstrates the way
 to connect your bot with [botanalytics](https://botanalytics.co/). Furthermore,
-it will be better to check [with-express example](../with-express) first.
+it will be better to check [server-express example](../server-express) first.
 
 ```js
 const server = createServer(bot, {
@@ -31,7 +31,8 @@ const server = createServer(bot, {
 
 ## Related examples
 
-* [with-chatbase](../with-chatbase)
-* [with-botimize](../with-botimize)
-* [with-express](../with-express)
+* [analytics-chatbase](../analytics-chatbase)
+* [analytics-dashbot](../analytics-dashbot)
+* [analytics-botimize](../analytics-botimize)
+* [server-express](../server-express)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-botanalytics/botanalyticsMiddleware.js b/examples/analytics-botanalytics/botanalyticsMiddleware.js
similarity index 100%
rename from examples/with-botanalytics/botanalyticsMiddleware.js
rename to examples/analytics-botanalytics/botanalyticsMiddleware.js
diff --git a/examples/with-botanalytics/index.js b/examples/analytics-botanalytics/index.js
similarity index 100%
rename from examples/with-botanalytics/index.js
rename to examples/analytics-botanalytics/index.js
diff --git a/examples/with-botanalytics/package.json b/examples/analytics-botanalytics/package.json
similarity index 100%
rename from examples/with-botanalytics/package.json
rename to examples/analytics-botanalytics/package.json
diff --git a/examples/with-botimize/README.md b/examples/analytics-botimize/README.md
similarity index 69%
rename from examples/with-botimize/README.md
rename to examples/analytics-botimize/README.md
index 99faca41..8269e1b3 100644
--- a/examples/with-botimize/README.md
+++ b/examples/analytics-botimize/README.md
@@ -1,12 +1,12 @@
-# With Botimize
+# Analytics: Botimize
 
 ## Install and Run
 
 Download this example or clone [Bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-botimize
-cd with-botimize
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/analytics-botimize
+cd analytics-botimize
 npm install
 npm run dev
 ```
@@ -18,7 +18,7 @@ case, we take [Botimize](https://www.getbotimize.com/) as an example.
 
 The following code is the main part of this example which demonstrates the way
 to connect your bot with [Botimize](https://www.getbotimize.com/). Furthermore,
-it will be better to check [with-express example](../with-express) first.
+it will be better to check [server-express example](../server-express) first.
 
 ```js
 const server = createServer(bot, {
@@ -32,7 +32,8 @@ const server = createServer(bot, {
 
 ## Related examples
 
-* [with-chatbase](../with-chatbase)
-* [with-botanalytics](../with-botanalytics)
-* [with-express](../with-express)
+* [analytics-chatbase](../analytics-chatbase)
+* [analytics-dashbot](../analytics-dashbot)
+* [analytics-botanalytics](../analytics-botanalytics)
+* [server-express](../server-express)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-botimize/botimizeMiddleware.js b/examples/analytics-botimize/botimizeMiddleware.js
similarity index 100%
rename from examples/with-botimize/botimizeMiddleware.js
rename to examples/analytics-botimize/botimizeMiddleware.js
diff --git a/examples/with-botimize/index.js b/examples/analytics-botimize/index.js
similarity index 100%
rename from examples/with-botimize/index.js
rename to examples/analytics-botimize/index.js
diff --git a/examples/with-botimize/package.json b/examples/analytics-botimize/package.json
similarity index 100%
rename from examples/with-botimize/package.json
rename to examples/analytics-botimize/package.json
diff --git a/examples/with-chatbase/README.md b/examples/analytics-chatbase/README.md
similarity index 69%
rename from examples/with-chatbase/README.md
rename to examples/analytics-chatbase/README.md
index a1b42d44..801fa30b 100644
--- a/examples/with-chatbase/README.md
+++ b/examples/analytics-chatbase/README.md
@@ -1,12 +1,12 @@
-# With Chatbase
+# Analytics: Chatbase
 
 ## Install and Run
 
 Download this example or clone [Bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-chatbase
-cd with-chatbase
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/analytics-chatbase
+cd analytics-chatbase
 npm install
 npm run dev
 ```
@@ -19,7 +19,7 @@ as an example.
 
 The following code is the main part of this example which demonstrates the way
 to connect your bot with [Chatbase](https://chatbase.com/welcome). Furthermore,
-it will be better to check [with-express example](../with-express) first.
+it will be better to check [server-express example](../server-express) first.
 
 ```js
 const server = createServer(bot, {
@@ -33,7 +33,8 @@ const server = createServer(bot, {
 
 ## Related examples
 
-* [with-botimize](../with-botimize)
-* [with-botanalytics](../with-botanalytics)
-* [with-express](../with-express)
+* [analytics-dashbot](../analytics-dashbot)
+* [analytics-botimize](../analytics-botimize)
+* [analytics-botanalytics](../analytics-botanalytics)
+* [server-express](../server-express)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-chatbase/chatbaseMiddleware.js b/examples/analytics-chatbase/chatbaseMiddleware.js
similarity index 100%
rename from examples/with-chatbase/chatbaseMiddleware.js
rename to examples/analytics-chatbase/chatbaseMiddleware.js
diff --git a/examples/with-chatbase/index.js b/examples/analytics-chatbase/index.js
similarity index 100%
rename from examples/with-chatbase/index.js
rename to examples/analytics-chatbase/index.js
diff --git a/examples/with-chatbase/package.json b/examples/analytics-chatbase/package.json
similarity index 100%
rename from examples/with-chatbase/package.json
rename to examples/analytics-chatbase/package.json
diff --git a/examples/analytics-dashbot/README.md b/examples/analytics-dashbot/README.md
new file mode 100644
index 00000000..2ae7480c
--- /dev/null
+++ b/examples/analytics-dashbot/README.md
@@ -0,0 +1,39 @@
+# Analytics: Dashbot
+
+## Install and Run
+
+Download this example or clone [Bottender](https://github.com/Yoctol/bottender).
+
+```
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/analytics-dashbot
+cd analytics-dashbot
+npm install
+npm run dev
+```
+
+## Idea of this example
+
+This example shows how to combine your bot with **bot analytics tool**. In this
+case, we take [Dashbot](https://www.dashbot.io/) as an example.
+
+The following code is the main part of this example which demonstrates the way
+to connect your bot with [Dashbot](https://www.dashbot.io/). Furthermore, it
+will be better to check [server-express example](../server-express) first.
+
+```js
+const server = createServer(bot, {
+  verifyToken: '__FILL_YOUR_VERIFY_TOKEN_HERE__',
+  webhookMiddleware: dashbotMiddleware(bot, {
+    apiKey: '__FILL_YOUR_DASHBOT_KEY_HERE__',
+    platform: 'facebook',
+  }),
+});
+```
+
+## Related examples
+
+* [analytics-chatbase](../analytics-chatbase)
+* [analytics-botimize](../analytics-botimize)
+* [analytics-botanalytics](../analytics-botanalytics)
+* [server-express](../server-express)
+* [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/analytics-dashbot/dashbotMiddleware.js b/examples/analytics-dashbot/dashbotMiddleware.js
new file mode 100644
index 00000000..8bcc8906
--- /dev/null
+++ b/examples/analytics-dashbot/dashbotMiddleware.js
@@ -0,0 +1,37 @@
+const _dashbot = require('dashbot');
+
+module.exports = function dashbotMiddleware(bot, { apiKey, platform }) {
+  const dashbot = _dashbot(apiKey)[platform];
+
+  const { client } = bot.connector;
+  const accessToken = client._accessToken;
+  const axios = client.axios;
+
+  // Add a response interceptor
+  axios.interceptors.response.use(response => {
+    const { config } = response;
+    if (/graph\.facebook\.com.*\/me\/messages/.test(config.url)) {
+      const { recipient: { id }, message: { text } } = JSON.parse(config.data);
+      const requestData = {
+        url: `https://graph.facebook.com/v${client.version}/me/messages`,
+        qs: { access_token: accessToken },
+        method: 'POST',
+        json: {
+          recipient: { id },
+          message: {
+            text,
+          },
+        },
+      };
+
+      dashbot.logOutgoing(requestData, response.body);
+    }
+    return response;
+  });
+
+  return (req, res, next) => {
+    dashbot.logIncoming(req.body);
+
+    next();
+  };
+};
diff --git a/examples/analytics-dashbot/index.js b/examples/analytics-dashbot/index.js
new file mode 100644
index 00000000..2e3ea37d
--- /dev/null
+++ b/examples/analytics-dashbot/index.js
@@ -0,0 +1,25 @@
+const { MessengerBot } = require('bottender');
+const { createServer } = require('bottender/express');
+
+const dashbotMiddleware = require('./dashbotMiddleware');
+
+const bot = new MessengerBot({
+  accessToken: '__FILL_YOUR_TOKEN_HERE__',
+  appSecret: '__FILL_YOUR_SECRET_HERE__',
+});
+
+bot.onEvent(async context => {
+  await context.sendText('Hello World');
+});
+
+const server = createServer(bot, {
+  verifyToken: '__FILL_YOUR_VERIFY_TOKEN_HERE__',
+  webhookMiddleware: dashbotMiddleware(bot, {
+    apiKey: '__FILL_YOUR_DASHBOT_KEY_HERE__',
+    platform: 'facebook',
+  }),
+});
+
+server.listen(5000, () => {
+  console.log('server is running on 5000 port...');
+});
diff --git a/examples/analytics-dashbot/package.json b/examples/analytics-dashbot/package.json
new file mode 100644
index 00000000..ded7ac95
--- /dev/null
+++ b/examples/analytics-dashbot/package.json
@@ -0,0 +1,13 @@
+{
+  "dependencies": {
+    "bottender": "latest",
+    "dashbot": "^9.4.1"
+  },
+  "devDependencies": {
+    "nodemon": "^1.11.0"
+  },
+  "scripts": {
+    "dev": "nodemon index.js",
+    "start": "node index.js"
+  }
+}
diff --git a/examples/with-now-deployment/README.md b/examples/deployment-now/README.md
similarity index 86%
rename from examples/with-now-deployment/README.md
rename to examples/deployment-now/README.md
index f43a8642..70c41057 100644
--- a/examples/with-now-deployment/README.md
+++ b/examples/deployment-now/README.md
@@ -1,14 +1,14 @@
-[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/Yoctol/bottender/tree/master/examples/with-now-deployment)
+[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/Yoctol/bottender/tree/master/examples/deployment-now)
 
-# With now deployment
+# Deployment: now
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-now-deployment
-cd with-now-deployment
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/deployment-now
+cd deployment-now
 npm install
 ACCESS_TOKEN=<YOUR_TOKEN> APP_SECRET=<YOUR_SECRET> VERIFY_TOKEN=<YOUR_VERIFY_TOKEN> npm run dev
 ```
diff --git a/examples/with-now-deployment/index.js b/examples/deployment-now/index.js
similarity index 100%
rename from examples/with-now-deployment/index.js
rename to examples/deployment-now/index.js
diff --git a/examples/with-express/package.json b/examples/deployment-now/package.json
similarity index 100%
rename from examples/with-express/package.json
rename to examples/deployment-now/package.json
diff --git a/examples/with-express/README.md b/examples/server-express/README.md
similarity index 71%
rename from examples/with-express/README.md
rename to examples/server-express/README.md
index a7bba599..26fbf504 100644
--- a/examples/with-express/README.md
+++ b/examples/server-express/README.md
@@ -1,12 +1,12 @@
-# With Express
+# Server: Express
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-express
-cd with-express
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/server-express
+cd server-express
 npm install
 npm run dev
 ```
@@ -19,7 +19,7 @@ Check our [server guide](https://bottender.js.org/docs/Guides-Server) for more i
 
 ## Related examples
 
-* [with-koa](../with-koa)
-* [with-micro](../with-micro)
-* [with-restify](../with-restify)
+* [server-koa](../server-koa)
+* [server-micro](../server-micro)
+* [server-restify](../server-restify)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-express/index.js b/examples/server-express/index.js
similarity index 100%
rename from examples/with-express/index.js
rename to examples/server-express/index.js
diff --git a/examples/with-file-session/package.json b/examples/server-express/package.json
similarity index 100%
rename from examples/with-file-session/package.json
rename to examples/server-express/package.json
diff --git a/examples/with-koa/README.md b/examples/server-koa/README.md
similarity index 71%
rename from examples/with-koa/README.md
rename to examples/server-koa/README.md
index aedc8411..792cbaa7 100644
--- a/examples/with-koa/README.md
+++ b/examples/server-koa/README.md
@@ -1,12 +1,12 @@
-# With Koa
+# Server: Koa
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-koa
-cd with-koa
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/server-koa
+cd server-koa
 npm install
 npm run dev
 ```
@@ -19,7 +19,7 @@ Check our [server guide](https://bottender.js.org/docs/Guides-Server) for more i
 
 ## Related examples
 
-* [with-express](../with-express)
-* [with-micro](../with-micro)
-* [with-restify](../with-restify)
+* [server-express](../server-express)
+* [server-micro](../server-micro)
+* [server-restify](../server-restify)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-koa/index.js b/examples/server-koa/index.js
similarity index 100%
rename from examples/with-koa/index.js
rename to examples/server-koa/index.js
diff --git a/examples/with-koa/package.json b/examples/server-koa/package.json
similarity index 100%
rename from examples/with-koa/package.json
rename to examples/server-koa/package.json
diff --git a/examples/with-micro/README.md b/examples/server-micro/README.md
similarity index 71%
rename from examples/with-micro/README.md
rename to examples/server-micro/README.md
index 64252f9c..5e9c97ad 100644
--- a/examples/with-micro/README.md
+++ b/examples/server-micro/README.md
@@ -1,12 +1,12 @@
-# With Micro
+# Server: Micro
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-micro
-cd with-micro
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/server-micro
+cd server-micro
 npm install
 npm run dev
 ```
@@ -19,7 +19,7 @@ Check our [server guide](https://bottender.js.org/docs/Guides-Server) for more i
 
 ## Related examples
 
-* [with-express](../with-express)
-* [with-koa](../with-koa)
-* [with-restify](../with-restify)
+* [server-express](../server-express)
+* [server-koa](../server-koa)
+* [server-restify](../server-restify)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-micro/index.js b/examples/server-micro/index.js
similarity index 100%
rename from examples/with-micro/index.js
rename to examples/server-micro/index.js
diff --git a/examples/with-micro/package.json b/examples/server-micro/package.json
similarity index 100%
rename from examples/with-micro/package.json
rename to examples/server-micro/package.json
diff --git a/examples/with-restify/README.md b/examples/server-restify/README.md
similarity index 72%
rename from examples/with-restify/README.md
rename to examples/server-restify/README.md
index 39048355..f920979f 100644
--- a/examples/with-restify/README.md
+++ b/examples/server-restify/README.md
@@ -1,12 +1,12 @@
-# With Restify
+# Server: Restify
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-micro
-cd with-micro
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/server-micro
+cd server-micro
 npm install
 npm run dev
 ```
@@ -19,7 +19,7 @@ Check our [server guide](https://bottender.js.org/docs/Guides-Server) for more i
 
 ## Related examples
 
-* [with-express](../with-express)
-* [with-koa](../with-koa)
-* [with-micro](../with-micro)
+* [server-express](../server-express)
+* [server-koa](../server-koa)
+* [server-micro](../server-micro)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-restify/index.js b/examples/server-restify/index.js
similarity index 100%
rename from examples/with-restify/index.js
rename to examples/server-restify/index.js
diff --git a/examples/with-memory-session/package.json b/examples/server-restify/package.json
similarity index 100%
rename from examples/with-memory-session/package.json
rename to examples/server-restify/package.json
diff --git a/examples/with-file-session/.gitignore b/examples/session-file/.gitignore
similarity index 100%
rename from examples/with-file-session/.gitignore
rename to examples/session-file/.gitignore
diff --git a/examples/with-file-session/README.md b/examples/session-file/README.md
similarity index 65%
rename from examples/with-file-session/README.md
rename to examples/session-file/README.md
index 4a46d5b7..284b6541 100644
--- a/examples/with-file-session/README.md
+++ b/examples/session-file/README.md
@@ -1,12 +1,12 @@
-# File Session
+# Session: File
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-file-session
-cd with-file-session
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-file
+cd session-file
 npm install
 npm run dev
 ```
@@ -19,6 +19,6 @@ store sessions in your local file. For more information, check our
 
 ## Related examples
 
-* [with-memory-session](../with-memory-session)
-* [with-mongo-session](../with-mongo-session)
-* [with-redis-session](../with-redis-session)
+* [session-memory](../session-memory)
+* [session-mongo](../session-mongo)
+* [session-redis](../session-redis)
diff --git a/examples/with-file-session/index.js b/examples/session-file/index.js
similarity index 100%
rename from examples/with-file-session/index.js
rename to examples/session-file/index.js
diff --git a/examples/with-mongo-session/package.json b/examples/session-file/package.json
similarity index 100%
rename from examples/with-mongo-session/package.json
rename to examples/session-file/package.json
diff --git a/examples/with-memory-session/README.md b/examples/session-memory/README.md
similarity index 63%
rename from examples/with-memory-session/README.md
rename to examples/session-memory/README.md
index 8f960966..520fb68c 100644
--- a/examples/with-memory-session/README.md
+++ b/examples/session-memory/README.md
@@ -1,12 +1,12 @@
-# Memory Session
+# Session: Memory
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-memory-session
-cd with-memory-session
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-memory
+cd session-memory
 npm install
 npm run dev
 ```
@@ -19,6 +19,6 @@ more information, check our
 
 ## Related examples
 
-* [with-file-session](../with-file-session)
-* [with-mongo-session](../with-mongo-session)
-* [with-redis-session](../with-redis-session)
+* [session-file](../session-file)
+* [session-mongo](../session-mongo)
+* [session-redis](../session-redis)
diff --git a/examples/with-memory-session/index.js b/examples/session-memory/index.js
similarity index 100%
rename from examples/with-memory-session/index.js
rename to examples/session-memory/index.js
diff --git a/examples/with-now-deployment/package.json b/examples/session-memory/package.json
similarity index 100%
rename from examples/with-now-deployment/package.json
rename to examples/session-memory/package.json
diff --git a/examples/with-mongo-session/README.md b/examples/session-mongo/README.md
similarity index 65%
rename from examples/with-mongo-session/README.md
rename to examples/session-mongo/README.md
index db0a7022..2de5ccd7 100644
--- a/examples/with-mongo-session/README.md
+++ b/examples/session-mongo/README.md
@@ -1,12 +1,12 @@
-# MongoDB Session
+# Session: MongoDB
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-mongo-session
-cd with-mongo-session
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-mongo
+cd session-mongo
 npm install
 npm run dev
 ```
@@ -19,6 +19,6 @@ store sessions in your MongoDB. For more information, check our
 
 ## Related examples
 
-* [with-memory-session](../with-memory-session)
-* [with-file-session](../with-file-session)
-* [with-redis-session](../with-redis-session)
+* [session-memory](../session-memory)
+* [session-file](../session-file)
+* [session-redis](../session-redis)
diff --git a/examples/with-mongo-session/index.js b/examples/session-mongo/index.js
similarity index 100%
rename from examples/with-mongo-session/index.js
rename to examples/session-mongo/index.js
diff --git a/examples/with-redis-session/package.json b/examples/session-mongo/package.json
similarity index 100%
rename from examples/with-redis-session/package.json
rename to examples/session-mongo/package.json
diff --git a/examples/with-redis-session/README.md b/examples/session-redis/README.md
similarity index 65%
rename from examples/with-redis-session/README.md
rename to examples/session-redis/README.md
index 767f04c1..25b95f3d 100644
--- a/examples/with-redis-session/README.md
+++ b/examples/session-redis/README.md
@@ -1,12 +1,12 @@
-# Redis Session
+# Session: Redis
 
 ## Install and Run
 
 Download this example or clone [bottender](https://github.com/Yoctol/bottender).
 
 ```
-curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/with-redis-session
-cd with-redis-session
+curl https://codeload.github.com/Yoctol/bottender/tar.gz/master | tar -xz --strip=2 bottender-master/examples/session-redis
+cd session-redis
 npm install
 npm run dev
 ```
@@ -19,6 +19,6 @@ store sessions in your Redis server. For more information, check our
 
 ## Related examples
 
-* [with-memory-session](../with-memory-session)
-* [with-file-session](../with-file-session)
-* [with-mongo-session](../with-mongo-session)
+* [session-memory](../session-memory)
+* [session-file](../session-file)
+* [session-mongo](../session-mongo)
diff --git a/examples/with-redis-session/index.js b/examples/session-redis/index.js
similarity index 100%
rename from examples/with-redis-session/index.js
rename to examples/session-redis/index.js
diff --git a/examples/with-restify/package.json b/examples/session-redis/package.json
similarity index 100%
rename from examples/with-restify/package.json
rename to examples/session-redis/package.json
diff --git a/examples/with-config/README.md b/examples/with-config/README.md
index 670898bb..ec8762f7 100644
--- a/examples/with-config/README.md
+++ b/examples/with-config/README.md
@@ -21,6 +21,6 @@ separately. Therefore, we recommend you putting them all together into
 ## Related examples
 
 * [cross-platform](../cross-platform)
-* [with-express](../with-express)
+* [server-express](../server-express)
 * [messenger-hello-world](../messenger-hello-world)
 * [messenger-builder](../messenger-builder)
diff --git a/examples/with-nextjs-webview/README.md b/examples/with-nextjs-webview/README.md
index cc6741cd..b90e7636 100644
--- a/examples/with-nextjs-webview/README.md
+++ b/examples/with-nextjs-webview/README.md
@@ -19,7 +19,7 @@ more information, check [next.js official docs](https://zeit.co/blog/next4).
 
 ## Related examples
 
-* [with-express](../with-express)
-* [with-koa](../with-koa)
-* [with-micro](../with-micro)
-* [with-restify](../with-restify)
+* [server-express](../server-express)
+* [server-koa](../server-koa)
+* [server-micro](../server-micro)
+* [server-restify](../server-restify)
diff --git a/examples/with-ngrok/README.md b/examples/with-ngrok/README.md
index 08ec5f0c..49dc8b31 100644
--- a/examples/with-ngrok/README.md
+++ b/examples/with-ngrok/README.md
@@ -23,7 +23,7 @@ to worry about finding a public url for your server.
 
 ## Related examples
 
-* [with-express](../with-express)
-* [with-koa](../with-koa)
-* [with-restify](../with-restify)
+* [server-express](../server-express)
+* [server-koa](../server-koa)
+* [server-restify](../server-restify)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/examples/with-state/README.md b/examples/with-state/README.md
index d4beedf2..e456b571 100644
--- a/examples/with-state/README.md
+++ b/examples/with-state/README.md
@@ -19,7 +19,7 @@ users. For more information, check our
 
 ## Related examples
 
-* [with-memory-session](../with-memory-session)
-* [with-file-session](../with-file-session)
-* [with-mongo-session](../with-mongo-session)
-* [with-redis-session](../with-redis-session)
+* [session-memory](../session-memory)
+* [session-file](../session-file)
+* [session-mongo](../session-mongo)
+* [session-redis](../session-redis)
diff --git a/examples/with-typing/README.md b/examples/with-typing/README.md
index bfeb523e..ac62e30b 100644
--- a/examples/with-typing/README.md
+++ b/examples/with-typing/README.md
@@ -21,5 +21,5 @@ Notice that the unit of optional number of delay seconds is **millisecond**.
 
 ## Related examples
 
-* [with-express](../with-express)
+* [server-express](../server-express)
 * [messenger-hello-world](../messenger-hello-world)
diff --git a/src/context/SlackContext.js b/src/context/SlackContext.js
index 99222eb0..cc9dfa1b 100644
--- a/src/context/SlackContext.js
+++ b/src/context/SlackContext.js
@@ -58,7 +58,6 @@ export default class SlackContext extends Context implements PlatformContext {
     this._isHandled = true;
 
     return this._client.postMessage(channelId, text, {
-      as_user: true,
       ...options,
     });
   }
diff --git a/src/plugins/withTyping.js b/src/plugins/withTyping.js
index 1011d3ea..ffdabb44 100644
--- a/src/plugins/withTyping.js
+++ b/src/plugins/withTyping.js
@@ -2,15 +2,19 @@ import sleep from 'delay';
 
 const methods = [
   'sendText',
+  'sendMessage',
   'sendAttachment',
   'sendImage',
   'sendAudio',
   'sendVideo',
   'sendFile',
   'sendQuickReplies',
+  'sendTemplate',
   'sendGenericTemplate',
   'sendButtonTemplate',
   'sendListTemplate',
+  'sendOpenGraphTemplate',
+  'sendMediaTemplate',
   'sendReceiptTemplate',
   'sendAirlineBoardingPassTemplate',
   'sendAirlineCheckinTemplate',
@@ -28,7 +32,6 @@ const methods = [
   'sendVoice',
   'sendVenue',
   'sendContact',
-  'sendChatAction',
 ];
 
 export default options => context => {


Test patch:
diff --git a/src/context/__tests__/SlackContext.spec.js b/src/context/__tests__/SlackContext.spec.js
index 24e4ceb5..6868e4d3 100644
--- a/src/context/__tests__/SlackContext.spec.js
+++ b/src/context/__tests__/SlackContext.spec.js
@@ -91,9 +91,7 @@ describe('#postMessage', () => {
 
     await context.postMessage('xxx.com');
 
-    expect(client.postMessage).toBeCalledWith('C6A9RJJ3F', 'xxx.com', {
-      as_user: true,
-    });
+    expect(client.postMessage).toBeCalledWith('C6A9RJJ3F', 'xxx.com', {});
   });
 
   it('should support overwrite options', async () => {
@@ -130,9 +128,7 @@ describe('#postMessage', () => {
 
     await context.postMessage('xxx.com');
 
-    expect(client.postMessage).toBeCalledWith(id, 'xxx.com', {
-      as_user: true,
-    });
+    expect(client.postMessage).toBeCalledWith(id, 'xxx.com', {});
   });
 
   it('should get null channelId and call warning if no session', async () => {