mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 14:43:05 -04:00
alpha test
This commit is contained in:
parent
7076740ac3
commit
0cf158a967
2 changed files with 48 additions and 0 deletions
|
@ -19,6 +19,7 @@ module.exports = {
|
||||||
},
|
},
|
||||||
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
|
if(!process.env.TESTING_SERVER_IDS.split(';').includes(context.guild.id)) return;
|
||||||
context.triggerTyping();
|
context.triggerTyping();
|
||||||
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||||
try{
|
try{
|
||||||
|
|
47
commands/message/fun/disstrack.js
Normal file
47
commands/message/fun/disstrack.js
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
const { createEmbed } = require('../../../labscore/utils/embed')
|
||||||
|
const { format } = require('../../../labscore/utils/ansi')
|
||||||
|
const { editOrReply } = require('../../../labscore/utils/message')
|
||||||
|
|
||||||
|
const superagent = require('superagent')
|
||||||
|
const { codeblock } = require('../../../labscore/utils/markdown')
|
||||||
|
|
||||||
|
const { Permissions } = require("detritus-client/lib/constants");
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'disstrack',
|
||||||
|
label: 'text',
|
||||||
|
metadata: {
|
||||||
|
description: `Talk to ChatGPT.\n\n<:bonzi:1138585089891106836> He will explore the Internet with you as your very own friend and sidekick! He can talk, walk, and joke like no other friend you've ever had!`,
|
||||||
|
description_short: 'Talk to ChatGPT.',
|
||||||
|
examples: ['chat How many otter species are there?'],
|
||||||
|
category: 'hidden',
|
||||||
|
usage: 'chat <prompt>'
|
||||||
|
},
|
||||||
|
permissionsClient: [Permissions.EMBED_LINKS, Permissions.SEND_MESSAGES, Permissions.USE_EXTERNAL_EMOJIS, Permissions.READ_MESSAGE_HISTORY],
|
||||||
|
run: async (context, args) => {
|
||||||
|
if(!process.env.TESTING_SERVER_IDS.split(';').includes(context.guild.id)) return;
|
||||||
|
context.triggerTyping();
|
||||||
|
if(!args.text) return editOrReply(context, {embeds:[createEmbed("warning", context, `Missing Parameter (text).`)]})
|
||||||
|
try{
|
||||||
|
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
||||||
|
.set({
|
||||||
|
Authorization: process.env.AI_SERVER_KEY
|
||||||
|
})
|
||||||
|
.send({
|
||||||
|
prompt: "Write a disstrack about the subject the user supplies. The disstrack should have at least two verses and a chorus.",
|
||||||
|
input: [args.text],
|
||||||
|
temperature: 0.6,
|
||||||
|
model: "CHATGPT"
|
||||||
|
})
|
||||||
|
return editOrReply(context, {embeds:[createEmbed("default", context, {
|
||||||
|
description: codeblock("ansi", [res.body.output.substr(0, 2020)]),
|
||||||
|
footer: {
|
||||||
|
text: `This information may be inaccurate or biased • ${context.application.name}`
|
||||||
|
}
|
||||||
|
})]})
|
||||||
|
}catch(e){
|
||||||
|
console.log(e)
|
||||||
|
return editOrReply(context, {embeds:[createEmbed("error", context, `Unable to generate text.`)]})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue