Skip to content

Commit

Permalink
chore: has been updated (#1676)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyguerra committed Oct 11, 2023
1 parent 447831a commit a8757b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/scripting.md
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ const EXCLUDED_USERS = [
'12345' // Restrict access for a user ID for a contractor
]

robot.receiveMiddleware((context, next, done) => {
robot.receiveMiddleware(async context => {
if (EXCLUDED_USERS.some( id => context.response.message.user.id == id)) {
// Don't process this message further.
context.response.message.finish()
Expand All @@ -919,9 +919,9 @@ robot.receiveMiddleware((context, next, done) => {
}

// Don't process further middleware.
done()
return false
} else {
next(done)
return true
}
})
```
Expand Down

0 comments on commit a8757b2

Please sign in to comment.