A slack bot powered by Slack webhook events.
This is not using any of the Slack platform stuff. Trying to keep it simple by simply receiving webhook events from Slack and responding to those events however we want.
/slack/event
endpoint for webhookThis is a great project to contribute to as a member of the devICT community!
This project runs on TypeScript with Deno.
brew install deno
, or several other methods.env.example
to .env
SLACK_TOKEN
in to .env
(reach out todeno task cache
to download dependenciesdeno task start
There is a separate Slack app for development (@bot (test)
) that can be used.
Reach out to @seth in Slack for
the SLACK_TOKEN
.
Simulate events from Slack hitting your local server with the
bin/simulate-message
util.
$ bin/simulate-message.ts "@bot ping"
or for windows
deno run --env --allow-env --allow-net .\bin\simulate-message.ts "@bot ping"
You won't see the simulated message in Slack, but the response will show up
there from @bot (test)
.
To test reply in thread responses, you can pass a thread_ts
to the simulate-message.ts command
.
$ bin/simulate-message.ts "@bot events" "1724586898.242849"
To get the thread_ts
for your message:
#bot-testing
channelthread_ts
query param from the URLThis bot is installed in the devICT work space as a Slack app called bot.
SLACK_TOKEN
needed to power the bot.
app_mentions:read
, chat:write
app_mention
A list of all the events can be seen here.
The events the bot responds to are defined in the events.ts
module. Typebox
schemas are defined for the events we respond to.
Note: If we want to respond to new event types, we will need to add them in the Slack app console before Slack will start sending them.
Bot is deployed on Deno Deploy. The Slack App points to the /slack/event
endpoint of the deployed bot API (this repo).