···3030 <img src="/.github/images/has_account.webp" width="500" alt="creating an account - success"/>
3131</p>
32323333+### From a developer's perspective
3434+3535+There is a sweet message queue that is used to handle all hackatime slack messages. This is handled and persisted across restarts with `bun:sqlite`. To access the queue you need an admin token which you can ask me for on slack ([@krn](https://hackclub.slack.com/team/U062UG485EE)).
3636+3737+The queue is interacted with via a `POST` request to `/slack/message` with a `channel`, `text`, and (optionally) `blocks` json encoded in the body.
3838+3939+```bash
4040+curl -X POST "https://hackatime-bot.kierank.hackclub.app/slack/message" \
4141+-H "Content-Type: application/json" \
4242+-H "Authorization: Bearer NOTLEEKINGTHATLOL" \
4343+-d '{
4444+ "channel": "U062UG485EE",
4545+ "text": "Hello from hackatime!"
4646+}'
4747+```
4848+4949+or via fetch with blocks
5050+5151+```typescript
5252+await fetch("https://hackatime-bot.kierank.hackclub.app/slack/message", {
5353+ method: "POST",
5454+ headers: {
5555+ "Content-Type": "application/json",
5656+ Authorization: `Bearer ${process.env.MESSAGE_QUEUE_TOKEN}`,
5757+ },
5858+ body: JSON.stringify({
5959+ channel: "U062UG485EE",
6060+ text: "Hello from hackatime!",
6161+ blocks: [
6262+ {
6363+ type: "section",
6464+ text: {
6565+ type: "mrkdwn",
6666+ text: "Hello from hackatime!",
6767+ },
6868+ },
6969+ {
7070+ type: "divider",
7171+ },
7272+ {
7373+ type: "context",
7474+ elements: [
7575+ {
7676+ type: "mrkdwn",
7777+ text: "This is a message from the hackatime slack bot!",
7878+ },
7979+ ],
8080+ },
8181+ ],
8282+ }),
8383+});
8484+```
8585+3386## Devving
34873588Create a slack app as per the [manifest.yaml](manifest.yaml) and an env as below