Advertisement
AnshorFalahi

genimg_respon

Jul 12th, 2024 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.run = {
  2.     usage: ['genimage'],
  3.     hiden: ['genimage'],
  4.     use: 'text',
  5.     category: 'utilities',
  6.     async: async (m, {
  7.       client,
  8.       text,
  9.       isPrefix,
  10.       command,
  11.       Func,
  12.       args
  13.     }) => {
  14.       try {
  15.         let old = new Date()
  16.         await client.sendReact(m.chat, '🕒', m.key)
  17.         let [prompt, model, sampler] = text.split`|`
  18.         const json = await Api.neoxr('/genimg', {
  19.             prompt: prompt,
  20.             model: model,
  21.             sampler: sampler
  22.          })
  23.         if (!json.status) return client.reply(m.chat, global.status.fail, m)
  24.         let data = json.data
  25.         //client.reply(m.chat, data, m)
  26.         client.sendFile(m.chat, data.url, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
  27.       } catch (e) {
  28.           client.reply(m.chat, Func.jsonFormat(e), m)
  29.       }
  30.     },
  31.     error: false,
  32.     limit: true,
  33.     cache: true,
  34.     location: __filename
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement