Slack bot that handles ticketing in the #ask-the-stonemasons channel on the Hack Club Slack. Built for the Siege YSWS (in both senses of "built for" ;-)).
NOTE: Currently the FAQ and AI stuff don't work, and that's because Hack Club AI is down! Sadly I can't do anything about that so you'll have to believe me that it worked :((
Head over to #ask-the-stonemasons and send a message to open a ticket. This will forward the message into a stonemason-only backend channel, where they can resolve the ticket or assign it to someone.
Other features:
- There's a really simple API to get a Siege project's basic info! You can use https://stonepheus.davidwhy.hackclub.app/api/projects/{id} without authentication.
- Stonepheus performs link previews through a Slack feature called "link unfurling". It shows the project's name, description, screenshot, links, and other details. Send a Siege project link in any channel to try it out!
- When you ask a question in #ask-the-stonemasons, an AI will attempt to answer your question with the FAQ and Theme Info documents. It might make a mistake though, so wait for a stonemason to confirm!
- When you type
?faq xyzin a thread, it will attempt to pull a section about "xyz" from the FAQ document. For example,?faq demopulls up the section about demos and shipping! - There are the
/siege-faqand/siege-querycommands, which will pull a section from the FAQ and ask an AI about a topic, respectively. (The same thing that powers the previous two features!)
- Install Bun on your device.
- Copy the
.env.examplefile as.env.localand edit the values as necessary. - Run
bun prodto start the server.
Alternatively, run the Dockerfile. You should know how to do that (because I don't :p)
Slack bots, unlike Discord bots, use webhooks instead of WebSocket connections by default. (Both can be configured to use the other though, but Discord only supports message events over WebSocket AFAIK.) So there are three endpoints:
/slack/events-endpointwhich handlesmessageevents/slack/interactivity-endpointwhich handles button clicks ("close ticket" button)/slack/command/{name}which handles slash commands (for stonemasons to choose anonymous or not)
The webhook is hosted on Nest at https://stonepheus.davidwhy.hackclub.app (there is no home page though so it would just be 404 if you tried to open that).
AI was not used at all for most of this project, except for the Dockerfile (idk how to do that) and a single regular expression in src/utils.ts (because how does a human being write a regex correctly).