mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-11 07:33:14 -04:00
expose style parameter
This commit is contained in:
parent
b5da631448
commit
10106fe095
1 changed files with 20 additions and 4 deletions
|
@ -10,17 +10,31 @@ const { STATIC_ICONS } = 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");
|
||||||
|
|
||||||
|
const IMAGE_STYLES = [
|
||||||
|
"flower",
|
||||||
|
"mineral",
|
||||||
|
"art",
|
||||||
|
"characters",
|
||||||
|
"terrain",
|
||||||
|
"curious",
|
||||||
|
"dreamscapes",
|
||||||
|
"translucent"
|
||||||
|
]
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'aiwallpaper',
|
name: 'wallpaper',
|
||||||
label: 'text',
|
label: 'text',
|
||||||
aliases: ['wallpaper'],
|
aliases: ['aiwp'],
|
||||||
metadata: {
|
metadata: {
|
||||||
description: `${iconPill("generative_ai", "LIMITED TESTING")}\n\nCreate Wallpapers`,
|
description: `${iconPill("generative_ai", "LIMITED TESTING")}\n\nCreate Wallpapers\n\nAvailable styles: \`${IMAGE_STYLES.join(', ')}\``,
|
||||||
description_short: 'Create Wallpapers',
|
description_short: 'Create Wallpapers',
|
||||||
examples: ['aiwp northern lights -style art'],
|
examples: ['aiwp northern lights -style art'],
|
||||||
category: 'limited',
|
category: 'limited',
|
||||||
usage: 'aiwallpaper <prompt>'
|
usage: 'aiwallpaper <prompt>'
|
||||||
},
|
},
|
||||||
|
args: [
|
||||||
|
{ name: 'style', default: 'translucent', required: false, help: "Image Style." },
|
||||||
|
],
|
||||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.ATTACH_FILES, Permissions.READ_MESSAGE_HISTORY],
|
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.ATTACH_FILES, Permissions.READ_MESSAGE_HISTORY],
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
if(!await hasFeature(context, "ai/wallpapers")) return;
|
if(!await hasFeature(context, "ai/wallpapers")) return;
|
||||||
|
@ -30,10 +44,12 @@ module.exports = {
|
||||||
|
|
||||||
let input = args.text;
|
let input = args.text;
|
||||||
|
|
||||||
|
if(!IMAGE_STYLES.includes(args.style.toLowerCase())) return editOrReply(context, createEmbed("warning", context, `Invalid Parameter (style).`))
|
||||||
|
|
||||||
try{
|
try{
|
||||||
await editOrReply(context, createEmbed("ai", context, "Generating Image..."))
|
await editOrReply(context, createEmbed("ai", context, "Generating Image..."))
|
||||||
|
|
||||||
let res = await aiWallpaper(context, args.text, "translucent");
|
let res = await aiWallpaper(context, args.text, args.style.toLowerCase());
|
||||||
let imgName = `lcwp.${Date.now().toString(36)}.jpeg`;
|
let imgName = `lcwp.${Date.now().toString(36)}.jpeg`;
|
||||||
|
|
||||||
return editOrReply(context, {
|
return editOrReply(context, {
|
Loading…
Add table
Add a link
Reference in a new issue