mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
add wp
This commit is contained in:
parent
a8aa4f5470
commit
006d7581ad
3 changed files with 13 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
const { PERMISSION_GROUPS } = require("#constants");
|
const { PERMISSION_GROUPS } = require("#constants");
|
||||||
const { wallpaper } = require("#obelisk");
|
const { GenerativeImagesModelsWallpaper } = require("#obelisk");
|
||||||
|
|
||||||
const { createEmbed } = require("#utils/embed");
|
const { createEmbed } = require("#utils/embed");
|
||||||
const { acknowledge } = require("#utils/interactions");
|
const { acknowledge } = require("#utils/interactions");
|
||||||
|
@ -17,19 +17,18 @@ module.exports = {
|
||||||
description_short: 'Create Wallpapers',
|
description_short: 'Create Wallpapers',
|
||||||
examples: ['wallpaper a painting of northern lights, in the bauhaus style -format square'],
|
examples: ['wallpaper a painting of northern lights, in the bauhaus style -format square'],
|
||||||
category: 'broken',
|
category: 'broken',
|
||||||
usage: 'wallpaper <prompt> [-format <square|wide>]'
|
usage: 'wallpaper <prompt> [-format <square|landscape>]'
|
||||||
},
|
},
|
||||||
args: [
|
args: [
|
||||||
{ name: 'format', default: 'wide', required: false, help: "Image style (wide, square)." }
|
{ name: 'format', default: 'landscape', required: false, help: "Image style (landscape, square)." }
|
||||||
],
|
],
|
||||||
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
|
permissionsClient: [...PERMISSION_GROUPS.baseline, ...PERMISSION_GROUPS.attachments],
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
return;
|
if(!await hasFeature(context, "ai/imagen")) return;
|
||||||
if(!await hasFeature(context, "ai/wallpapers")) return;
|
|
||||||
await acknowledge(context);
|
await acknowledge(context);
|
||||||
|
|
||||||
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).`))
|
|
||||||
try{
|
try{
|
||||||
let load = createEmbed("defaultNoFooter", context, {
|
let load = createEmbed("defaultNoFooter", context, {
|
||||||
url: "https://bignutty.gitlab.io",
|
url: "https://bignutty.gitlab.io",
|
||||||
|
@ -45,7 +44,7 @@ module.exports = {
|
||||||
|
|
||||||
await editOrReply(context, {embeds: loadingEmbeds});
|
await editOrReply(context, {embeds: loadingEmbeds});
|
||||||
|
|
||||||
let res = await wallpaper(context, args.text, args.format.toLowerCase());
|
let res = await GenerativeImagesModelsWallpaper(context, args.text, args.format.toUpperCase());
|
||||||
|
|
||||||
// Construct Embeds
|
// Construct Embeds
|
||||||
let files = [];
|
let files = [];
|
||||||
|
|
|
@ -69,6 +69,13 @@ module.exports.GenerativeImagesModelsImagen = async function(context, prompt){
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module.exports.GenerativeImagesModelsWallpaper = async function(context, prompt, format){
|
||||||
|
return await request(ObeliskApi.GENERATIVEIMAGES_MODELS_WALLPAPER, "POST", {}, {
|
||||||
|
image_prompt: prompt,
|
||||||
|
format
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports.WebUtilsWebPageScreenshot = async function(context, url, allow_adult){
|
module.exports.WebUtilsWebPageScreenshot = async function(context, url, allow_adult){
|
||||||
return await request(ObeliskApi.WEBUTILS_WEBPAGE_SCREENSHOT, "POST", {}, {
|
return await request(ObeliskApi.WEBUTILS_WEBPAGE_SCREENSHOT, "POST", {}, {
|
||||||
url,
|
url,
|
||||||
|
|
0
labscore/cardstack/index.js
Normal file
0
labscore/cardstack/index.js
Normal file
Loading…
Add table
Add a link
Reference in a new issue