providing password reset services for a long while: circa 2025

feat: add command

Changed files
+61 -14
features
+50
features/command.ts
···
+
import { slackApp } from "../index";
+
+
const command = async () => {
+
slackApp.command("/hackatime", async ({ context, payload }) => {
+
context.respond({
+
response_type: "ephemeral",
+
text: "Hi there! I'm the Hackatime bot :hyper-dino-wave:",
+
blocks: [
+
{
+
type: "section",
+
text: {
+
type: "mrkdwn",
+
text: "Hi there! I'm the Hackatime bot :hyper-dino-wave:",
+
},
+
},
+
{
+
type: "section",
+
text: {
+
type: "mrkdwn",
+
text: "I can see that you don't have an account yet. Do you want me to make you one?",
+
},
+
},
+
{
+
type: "actions",
+
elements: [
+
{
+
type: "button",
+
text: {
+
type: "plain_text",
+
text: "Yes, please!",
+
},
+
value: "yes",
+
style: "primary",
+
},
+
{
+
type: "button",
+
text: {
+
type: "plain_text",
+
text: "No, thanks",
+
},
+
value: "no",
+
},
+
],
+
},
+
],
+
});
+
});
+
};
+
+
export default command;
-9
features/example.ts
···
-
import { slackApp } from "../index";
-
-
const example = async () => {
-
slackApp.action("example_action", async ({ context, payload }) => {
-
console.log("Example Action", payload);
-
});
-
};
-
-
export default example;
+1 -1
features/index.ts
···
-
export { default as example } from "./example";
+
export { default as command } from "./command";
+10 -4
manifest.yaml
···
bot_user:
display_name: hackatime
always_online: true
+
slash_commands:
+
- command: /hackatime
+
url: https://casual-renewing-reptile.ngrok-free.app/slack
+
description: manage your hackatime account!
+
should_escape: true
oauth_config:
scopes:
bot:
+
- channels:join
- channels:read
- chat:write
- chat:write.public
-
- channels:join
+
- commands
- users.profile:read
- users:read
+
- users:read.email
settings:
-
event_subscriptions:
+
interactivity:
+
is_enabled: true
request_url: https://casual-renewing-reptile.ngrok-free.app/slack
-
bot_events:
-
- channel_created
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false