Added DALL-E functionaity
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
const { submitPromptTransaction } = require("../controllers/chatGptController");
|
||||
const { submitTextPromptTransaction } = require("../controllers/openAiController");
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder");
|
||||
const log = new DebugBuilder("server", "chat");
|
||||
const { EmmeliaEmbedBuilder } = require('../libUtils');
|
||||
|
||||
const COST_OF_COMMAND = 100
|
||||
|
||||
module.exports = {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('chat')
|
||||
.setDescription('Send a text prompt to ChatGPT')
|
||||
.setDescription(`Send a text prompt to ChatGPT, by default this command costs *${COST_OF_COMMAND}* tokens`)
|
||||
.addStringOption(option =>
|
||||
option.setName('prompt')
|
||||
.setDescription('The prompt to be sent to ChatGPT')
|
||||
@@ -36,7 +37,7 @@ module.exports = {
|
||||
const maxTokens = interaction.options.getNumber('tokens') ?? undefined;
|
||||
const discordAccountId = interaction.member.id;
|
||||
try {
|
||||
submitPromptTransaction(promptText, temperature, maxTokens, discordAccountId, async (err, result) => {
|
||||
submitTextPromptTransaction(promptText, temperature, maxTokens, discordAccountId, async (err, result) => {
|
||||
if (err) throw err;
|
||||
|
||||
const gptEmbed = new EmmeliaEmbedBuilder()
|
||||
|
||||
Reference in New Issue
Block a user