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

@ -6,6 +6,7 @@ const { STATICS } = require('#utils/statics');
const superagent = require('superagent');
const { PERMISSION_GROUPS } = require("#constants");
const { acknowledge } = require("#utils/interactions");
module.exports = {
name: 'qr',
@ -20,7 +21,8 @@ module.exports = {
},
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
run: async (context, args) => {
await acknowledge(context);
// If we have an argument, generate code
if(args.text.length){
let response = await editOrReply(context, createEmbed("loading", context, `Generating qr code...`))
@ -49,8 +51,6 @@ module.exports = {
if (!image) return editOrReply(context, createEmbed("warning", context, "No images found."))
try {
await context.triggerTyping();
const t = Date.now();
let res = await superagent.get(`https://api.qrserver.com/v1/read-qr-code/`)