mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
support multiple images
This commit is contained in:
parent
10106fe095
commit
eb944dd1d3
1 changed files with 27 additions and 1 deletions
|
@ -50,8 +50,34 @@ module.exports = {
|
||||||
await editOrReply(context, createEmbed("ai", context, "Generating Image..."))
|
await editOrReply(context, createEmbed("ai", context, "Generating Image..."))
|
||||||
|
|
||||||
let res = await aiWallpaper(context, args.text, args.style.toLowerCase());
|
let res = await aiWallpaper(context, args.text, args.style.toLowerCase());
|
||||||
|
|
||||||
|
// Construct Embeds
|
||||||
|
let files = [];
|
||||||
|
let embeds = res.response.body.images.map((i)=>{
|
||||||
let imgName = `lcwp.${Date.now().toString(36)}.jpeg`;
|
let imgName = `lcwp.${Date.now().toString(36)}.jpeg`;
|
||||||
|
|
||||||
|
files.push({
|
||||||
|
filename: imgName,
|
||||||
|
value: Buffer.from(i, 'base64')
|
||||||
|
})
|
||||||
|
return createEmbed("defaultNoFooter", context, {
|
||||||
|
url: "https://bignutty.gitlab.io",
|
||||||
|
author: {
|
||||||
|
iconUrl: STATIC_ICONS.ai_image,
|
||||||
|
name: stringwrap(args.text, 50, false),
|
||||||
|
},
|
||||||
|
image: {
|
||||||
|
url: `attachment://${imgName}`
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
text: `Generative AI is experimental • Use AI Images responsibly.`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
return editOrReply(context, {embeds, files})
|
||||||
|
|
||||||
|
|
||||||
return editOrReply(context, {
|
return editOrReply(context, {
|
||||||
embeds:[createEmbed("defaultNoFooter", context, {
|
embeds:[createEmbed("defaultNoFooter", context, {
|
||||||
author: {
|
author: {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue