mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 04:00:10 +00:00
mom: fix attachment downloads - pass store to SlackBot, process files, use absolute paths
This commit is contained in:
parent
d277d739b3
commit
e3576fe016
4 changed files with 246 additions and 107 deletions
|
|
@ -100,7 +100,7 @@ function createSlackContext(event: SlackEvent, slack: SlackBot, state: ChannelSt
|
|||
userName: user?.userName,
|
||||
channel: event.channel,
|
||||
ts: event.ts,
|
||||
attachments: [],
|
||||
attachments: (event.attachments || []).map((a) => ({ local: a.local })),
|
||||
},
|
||||
channelName: slack.getChannel(event.channel)?.name,
|
||||
store: state.store,
|
||||
|
|
@ -243,10 +243,14 @@ const handler: MomHandler = {
|
|||
|
||||
log.logStartup(workingDir, sandbox.type === "host" ? "host" : `docker:${sandbox.container}`);
|
||||
|
||||
// Shared store for attachment downloads (also used per-channel in getState)
|
||||
const sharedStore = new ChannelStore({ workingDir, botToken: MOM_SLACK_BOT_TOKEN! });
|
||||
|
||||
const bot = new SlackBotClass(handler, {
|
||||
appToken: MOM_SLACK_APP_TOKEN,
|
||||
botToken: MOM_SLACK_BOT_TOKEN,
|
||||
workingDir,
|
||||
store: sharedStore,
|
||||
});
|
||||
|
||||
bot.start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue