Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/khrj/slack-socket-mode
Recieve events from Slack's Events API over a WebSocket connection. Deno port of @slack/socket-mode
https://github.com/khrj/slack-socket-mode
deno slack slack-api socket-mode
Last synced: about 1 month ago
JSON representation
Recieve events from Slack's Events API over a WebSocket connection. Deno port of @slack/socket-mode
- Host: GitHub
- URL: https://github.com/khrj/slack-socket-mode
- Owner: khrj
- License: mit
- Created: 2021-02-10T15:20:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-13T05:47:49.000Z (over 3 years ago)
- Last Synced: 2024-10-09T00:22:37.503Z (about 1 month ago)
- Topics: deno, slack, slack-api, socket-mode
- Language: TypeScript
- Homepage: https://deno.land/x/slack_socket_mode
- Size: 42 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Slack Socket Mode
Recieve events from Slack's Events API over a WebSocket connection. Deno port of @slack/socket-mode
## Usage
```ts
import "https://deno.land/x/[email protected]/load.ts"
import { SocketModeClient } from "https://deno.land/x/[email protected]/mod.ts"const appToken = Deno.env.get("SLACK_APP_TOKEN")
const socketModeClient = new SocketModeClient({ appToken })// Attach listeners to events by type. See: https://api.slack.com/events/message
socketModeClient.addEventListener("message", ({ detail: { body, ack } }) => {
ack()
console.log(body)
})await socketModeClient.start()
```## API
- API is similar to the [node @slack/socket-mode](https://www.npmjs.com/package/@slack/socket-mode), where `.addEventListener` is used instead of `.on` ([EventTarget docs](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget))
- Complete [generated docs](https://doc.deno.land/https/deno.land/x/[email protected]/mod.ts) are also available## Supporters
[![Stargazers repo roster for @khrj/slack-socket-mode](https://reporoster.com/stars/khrj/slack-socket-mode)](https://github.com/khrj/slack-socket-mode/stargazers)
[![Forkers repo roster for @khrj/slack-socket-mode](https://reporoster.com/forks/khrj/slack-socket-mode)](https://github.com/khrj/slack-socket-mode/network/members)
## Related
- [Deno Slack SDK](https://github.com/slack-deno/deno-slack-sdk)
- [Deno modules](https://github.com/khrj/deno-modules)