providing password reset services for a long while: circa 2025

feat: add command

+61 -14
+50
features/command.ts
··· 1 + import { slackApp } from "../index"; 2 + 3 + const command = async () => { 4 + slackApp.command("/hackatime", async ({ context, payload }) => { 5 + context.respond({ 6 + response_type: "ephemeral", 7 + text: "Hi there! I'm the Hackatime bot :hyper-dino-wave:", 8 + blocks: [ 9 + { 10 + type: "section", 11 + text: { 12 + type: "mrkdwn", 13 + text: "Hi there! I'm the Hackatime bot :hyper-dino-wave:", 14 + }, 15 + }, 16 + { 17 + type: "section", 18 + text: { 19 + type: "mrkdwn", 20 + text: "I can see that you don't have an account yet. Do you want me to make you one?", 21 + }, 22 + }, 23 + { 24 + type: "actions", 25 + elements: [ 26 + { 27 + type: "button", 28 + text: { 29 + type: "plain_text", 30 + text: "Yes, please!", 31 + }, 32 + value: "yes", 33 + style: "primary", 34 + }, 35 + { 36 + type: "button", 37 + text: { 38 + type: "plain_text", 39 + text: "No, thanks", 40 + }, 41 + value: "no", 42 + }, 43 + ], 44 + }, 45 + ], 46 + }); 47 + }); 48 + }; 49 + 50 + export default command;
-9
features/example.ts
··· 1 - import { slackApp } from "../index"; 2 - 3 - const example = async () => { 4 - slackApp.action("example_action", async ({ context, payload }) => { 5 - console.log("Example Action", payload); 6 - }); 7 - }; 8 - 9 - export default example;
+1 -1
features/index.ts
··· 1 - export { default as example } from "./example"; 1 + export { default as command } from "./command";
+10 -4
manifest.yaml
··· 6 6 bot_user: 7 7 display_name: hackatime 8 8 always_online: true 9 + slash_commands: 10 + - command: /hackatime 11 + url: https://casual-renewing-reptile.ngrok-free.app/slack 12 + description: manage your hackatime account! 13 + should_escape: true 9 14 oauth_config: 10 15 scopes: 11 16 bot: 17 + - channels:join 12 18 - channels:read 13 19 - chat:write 14 20 - chat:write.public 15 - - channels:join 21 + - commands 16 22 - users.profile:read 17 23 - users:read 24 + - users:read.email 18 25 settings: 19 - event_subscriptions: 26 + interactivity: 27 + is_enabled: true 20 28 request_url: https://casual-renewing-reptile.ngrok-free.app/slack 21 - bot_events: 22 - - channel_created 23 29 org_deploy_enabled: false 24 30 socket_mode_enabled: false 25 31 token_rotation_enabled: false