mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
add loading state image to aiimg
This commit is contained in:
parent
a6a3eaaf05
commit
0e05d556c1
3 changed files with 27 additions and 12 deletions
|
@ -1,12 +1,10 @@
|
||||||
const { geminiVision, aiWallpaper, imagen } = require("../../../labscore/api/obelisk");
|
const { imagen } = require("../../../labscore/api/obelisk");
|
||||||
const { getRecentImage } = require("../../../labscore/utils/attachment");
|
|
||||||
const { createEmbed } = require("../../../labscore/utils/embed");
|
const { createEmbed } = require("../../../labscore/utils/embed");
|
||||||
const { editOrReply } = require("../../../labscore/utils/message");
|
const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const { getUser } = require("../../../labscore/utils/users");
|
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
|
||||||
const { STATIC_ICONS } = require("../../../labscore/utils/statics");
|
const { STATIC_ICONS, STATIC_ASSETS } = require("../../../labscore/utils/statics");
|
||||||
const { iconPill, stringwrap } = require("../../../labscore/utils/markdown");
|
const { iconPill, stringwrap } = require("../../../labscore/utils/markdown");
|
||||||
const { hasFeature } = require("../../../labscore/utils/testing");
|
const { hasFeature } = require("../../../labscore/utils/testing");
|
||||||
|
|
||||||
|
@ -29,12 +27,19 @@ module.exports = {
|
||||||
if(!args.text) return editOrReply(context, createEmbed("warning", context, `Missing Parameter (prompt).`))
|
if(!args.text) return editOrReply(context, createEmbed("warning", context, `Missing Parameter (prompt).`))
|
||||||
|
|
||||||
try{
|
try{
|
||||||
await editOrReply(context, createEmbed("defaultNoFooter", context, {
|
let load = createEmbed("defaultNoFooter", context, {
|
||||||
|
url: "https://bignutty.gitlab.io",
|
||||||
author: {
|
author: {
|
||||||
iconUrl: STATIC_ICONS.ai_image_processing,
|
iconUrl: STATIC_ICONS.ai_image_processing,
|
||||||
name: "Generating images..."
|
name: "Generating images..."
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
url: STATIC_ASSETS.image_loading
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
let loadingEmbeds = [load, load, load, load]
|
||||||
|
|
||||||
|
await editOrReply(context, {embeds: loadingEmbeds});
|
||||||
|
|
||||||
let res = await imagen(context, args.text);
|
let res = await imagen(context, args.text);
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
const { geminiVision, aiWallpaper, imagen, wallpaper } = require("../../../labscore/api/obelisk");
|
const { wallpaper } = require("../../../labscore/api/obelisk");
|
||||||
const { getRecentImage } = require("../../../labscore/utils/attachment");
|
|
||||||
const { createEmbed } = require("../../../labscore/utils/embed");
|
const { createEmbed } = require("../../../labscore/utils/embed");
|
||||||
const { editOrReply } = require("../../../labscore/utils/message");
|
const { editOrReply } = require("../../../labscore/utils/message");
|
||||||
const { getUser } = require("../../../labscore/utils/users");
|
|
||||||
|
|
||||||
const { Permissions } = require("detritus-client/lib/constants");
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
|
||||||
const { STATIC_ICONS } = require("../../../labscore/utils/statics");
|
const { STATIC_ICONS, STATIC_ASSETS } = require("../../../labscore/utils/statics");
|
||||||
const { iconPill, stringwrap } = require("../../../labscore/utils/markdown");
|
const { iconPill, stringwrap } = require("../../../labscore/utils/markdown");
|
||||||
const { hasFeature } = require("../../../labscore/utils/testing");
|
const { hasFeature } = require("../../../labscore/utils/testing");
|
||||||
|
|
||||||
|
@ -32,12 +30,19 @@ module.exports = {
|
||||||
if(!args.text) return editOrReply(context, createEmbed("warning", context, `Missing Parameter (prompt).`))
|
if(!args.text) return editOrReply(context, createEmbed("warning", context, `Missing Parameter (prompt).`))
|
||||||
if(!["wide","square"].includes(args.format.toLowerCase())) return editOrReply(context, createEmbed("warning", context, `Invalid Parameter (format).`))
|
if(!["wide","square"].includes(args.format.toLowerCase())) return editOrReply(context, createEmbed("warning", context, `Invalid Parameter (format).`))
|
||||||
try{
|
try{
|
||||||
await editOrReply(context, createEmbed("defaultNoFooter", context, {
|
let load = createEmbed("defaultNoFooter", context, {
|
||||||
|
url: "https://bignutty.gitlab.io",
|
||||||
author: {
|
author: {
|
||||||
iconUrl: STATIC_ICONS.ai_image_processing,
|
iconUrl: STATIC_ICONS.ai_image_processing,
|
||||||
name: "Generating images..."
|
name: "Generating images..."
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
url: STATIC_ASSETS.image_loading
|
||||||
}
|
}
|
||||||
}))
|
})
|
||||||
|
let loadingEmbeds = [load, load, load, load]
|
||||||
|
|
||||||
|
await editOrReply(context, {embeds: loadingEmbeds});
|
||||||
|
|
||||||
let res = await wallpaper(context, args.text, args.format.toLowerCase());
|
let res = await wallpaper(context, args.text, args.format.toLowerCase());
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,10 @@ const Statics = Object.freeze({
|
||||||
file: "loading/05_chat_loading.7y2ji893rho0.gif",
|
file: "loading/05_chat_loading.7y2ji893rho0.gif",
|
||||||
revision: 0
|
revision: 0
|
||||||
},
|
},
|
||||||
|
image_loading: {
|
||||||
|
file: "loading/image_loading_splash.2elegsql1j8k.png",
|
||||||
|
revision: 1
|
||||||
|
},
|
||||||
embed_invite_spacer: {
|
embed_invite_spacer: {
|
||||||
file: "misc/embed-spacer-botinvite.png",
|
file: "misc/embed-spacer-botinvite.png",
|
||||||
revision: 0
|
revision: 0
|
||||||
|
@ -231,5 +235,6 @@ module.exports.STATIC_ICONS = Object.freeze({
|
||||||
|
|
||||||
module.exports.STATIC_ASSETS = Object.freeze({
|
module.exports.STATIC_ASSETS = Object.freeze({
|
||||||
chat_loading: staticAsset(Statics.assets.chat_loading),
|
chat_loading: staticAsset(Statics.assets.chat_loading),
|
||||||
|
image_loading: staticAsset(Statics.assets.image_loading),
|
||||||
embed_invite_spacer: staticAsset(Statics.assets.embed_invite_spacer)
|
embed_invite_spacer: staticAsset(Statics.assets.embed_invite_spacer)
|
||||||
})
|
})
|
Loading…
Add table
Add a link
Reference in a new issue