unify typing logic for a more consistent experience

This commit is contained in:
bignutty 2024-12-08 15:00:18 +01:00
parent d2aeecf70d
commit 1ca74d3c2c
67 changed files with 240 additions and 109 deletions

View file

@ -3,6 +3,7 @@ const { geminiVision } = require("#obelisk");
const { getRecentImage } = require("#utils/attachment");
const { createEmbed } = require("#utils/embed");
const { acknowledge } = require("#utils/interactions");
const { stringwrap, iconPill, smallIconPill } = require("#utils/markdown");
const { editOrReply } = require("#utils/message");
const { STATIC_ICONS } = require("#utils/statics");
@ -22,8 +23,8 @@ module.exports = {
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
run: async (context, args) => {
if(!await hasFeature(context, "ai/gemini/vision")) return;
context.triggerTyping();
await acknowledge(context);
// for the sake of privacy, make the context window one message
let image = await getRecentImage(context, 1)
if (!image) return editOrReply(context, createEmbed("warning", context, "No images found. Reply if you want a specific image."))