Minor updates
This commit is contained in:
parent
08618e2be2
commit
7c09aaffaa
@ -397,7 +397,7 @@ const functions = {
|
|||||||
generatingResponse() {
|
generatingResponse() {
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
.setAuthor({ name: "NodBot powered by OpenAI", iconURL: "https://assets.vfsh.dev/openai-logos/PNGs/openai-logomark.png" })
|
.setAuthor({ name: "NodBot powered by OpenAI", iconURL: "https://assets.vfsh.dev/openai-logos/PNGs/openai-logomark.png" })
|
||||||
.setImage("https://tenor.com/view/sucks-gif-4499658")
|
.setImage("https://media.tenor.com/aHMHzNGCb4kAAAAC/sucks.gif")
|
||||||
.setDescription("Generating a response, please stand by.")
|
.setDescription("Generating a response, please stand by.")
|
||||||
.setFooter({ text: "Ligma balls" });
|
.setFooter({ text: "Ligma balls" });
|
||||||
return { embeds: [embed] };
|
return { embeds: [embed] };
|
||||||
|
@ -15,7 +15,7 @@ module.exports = {
|
|||||||
await interaction.editReply(fn.embeds.generatingResponse());
|
await interaction.editReply(fn.embeds.generatingResponse());
|
||||||
const userPrompt = interaction.options.getString("prompt");
|
const userPrompt = interaction.options.getString("prompt");
|
||||||
const response = await fn.openAI.chatPrompt(userPrompt).catch(e => console.error(e));
|
const response = await fn.openAI.chatPrompt(userPrompt).catch(e => console.error(e));
|
||||||
const responseText = response.choices[0].text.slice(2);
|
const responseText = response.choices[0].text;
|
||||||
const usage = {
|
const usage = {
|
||||||
tokens: response.usage.total_tokens,
|
tokens: response.usage.total_tokens,
|
||||||
usdc: response.usage.total_tokens * ( 0.2 / 1000 ) // 0.2¢ per 1000 tokens or 0.0002¢ per token.
|
usdc: response.usage.total_tokens * ( 0.2 / 1000 ) // 0.2¢ per 1000 tokens or 0.0002¢ per token.
|
||||||
|
Loading…
Reference in New Issue
Block a user