feat(bot,frontend,backend): add integration with external collaborative solver
This commit is contained in:
@@ -146,6 +146,24 @@ export const update = mutation({
|
||||
}
|
||||
});
|
||||
|
||||
export const setTelegramMessageId = mutation({
|
||||
args: { messageId: v.id('messages'), telegramMessageId: v.number() },
|
||||
returns: v.null(),
|
||||
handler: async (ctx, args) => {
|
||||
await ctx.db.patch(args.messageId, { telegramMessageId: args.telegramMessageId });
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
export const getTelegramMessageId = query({
|
||||
args: { messageId: v.id('messages') },
|
||||
returns: v.union(v.number(), v.null()),
|
||||
handler: async (ctx, args) => {
|
||||
const msg = await ctx.db.get(args.messageId);
|
||||
return msg?.telegramMessageId ?? null;
|
||||
}
|
||||
});
|
||||
|
||||
export const getHistoryForAI = query({
|
||||
args: { chatId: v.id('chats'), limit: v.optional(v.number()) },
|
||||
returns: v.array(
|
||||
|
||||
Reference in New Issue
Block a user