import { App } from "@slack/bolt";

const app = new App({
  token: process.env.SLACK_BOT_TOKEN,
  signingSecret: process.env.SLACK_SIGNING_SECRET,
  socketMode: true,
  appToken: process.env.SLACK_APP_TOKEN,
});

app.message("ping", async ({ say }) => {
  await say("Agentic OS slack-bot scaffold is online.");
});

async function main() {
  await app.start(process.env.PORT ? Number(process.env.PORT) : 3000);
}

main().catch((err) => {
  console.error(err);
  process.exit(1);
});
