mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
change typing indicator
This commit is contained in:
parent
caa0a2c3dc
commit
6d67d0ba23
4 changed files with 10 additions and 10 deletions
|
@ -31,7 +31,7 @@ module.exports = {
|
||||||
if(args.prompt !== "") prompt = args.prompt
|
if(args.prompt !== "") prompt = args.prompt
|
||||||
|
|
||||||
try{
|
try{
|
||||||
await editOrReply(context, createEmbed("typing", context, "Generating response..."))
|
await editOrReply(context, createEmbed("ai", context, "Generating response..."))
|
||||||
|
|
||||||
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
||||||
.set({
|
.set({
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = {
|
||||||
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{
|
||||||
await editOrReply(context, createEmbed("typing", context, "Generating response..."))
|
await editOrReply(context, createEmbed("ai", context, "Generating response..."))
|
||||||
|
|
||||||
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
let res = await superagent.post(`${process.env.AI_SERVER}/openai`)
|
||||||
.set({
|
.set({
|
||||||
|
|
|
@ -79,11 +79,11 @@ const embedTypes = Object.freeze({
|
||||||
color: COLORS.embed
|
color: COLORS.embed
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typing": (context) => {
|
"ai": (context) => {
|
||||||
return {
|
return {
|
||||||
author: {
|
author: {
|
||||||
iconUrl: STATIC_ICONS.typing,
|
iconUrl: STATIC_ICONS.ai,
|
||||||
name: `Loading`
|
name: `Generating`
|
||||||
},
|
},
|
||||||
color: COLORS.embed
|
color: COLORS.embed
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ module.exports.createEmbed = function(type, context, content){
|
||||||
if(!content) embedTypes[type](context)
|
if(!content) embedTypes[type](context)
|
||||||
let emb = embedTypes[type](context)
|
let emb = embedTypes[type](context)
|
||||||
|
|
||||||
if(["success","warning","error","loading","typing"].includes(type)){
|
if(["success","warning","error","loading","ai"].includes(type)){
|
||||||
emb.author.name = content
|
emb.author.name = content
|
||||||
return emb
|
return emb
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,9 +102,9 @@ const Statics = Object.freeze({
|
||||||
file: "icons/core/ico_notice_loading.gif",
|
file: "icons/core/ico_notice_loading.gif",
|
||||||
revision: 0
|
revision: 0
|
||||||
},
|
},
|
||||||
typing: {
|
ai: {
|
||||||
file: "icons/core/ico_notice_typing.gif",
|
file: "icons/core/ico_notice_ai.gif",
|
||||||
revision: 1
|
revision: 2
|
||||||
},
|
},
|
||||||
warning: {
|
warning: {
|
||||||
file: "icons/core/ico_notice_warning.png",
|
file: "icons/core/ico_notice_warning.png",
|
||||||
|
@ -149,6 +149,6 @@ module.exports.STATIC_ICONS = Object.freeze({
|
||||||
adult: staticAsset(Statics.icons.adult),
|
adult: staticAsset(Statics.icons.adult),
|
||||||
error: staticAsset(Statics.icons.error),
|
error: staticAsset(Statics.icons.error),
|
||||||
loading: staticAsset(Statics.icons.loading),
|
loading: staticAsset(Statics.icons.loading),
|
||||||
typing: staticAsset(Statics.icons.typing),
|
ai: staticAsset(Statics.icons.ai),
|
||||||
warning: staticAsset(Statics.icons.warning)
|
warning: staticAsset(Statics.icons.warning)
|
||||||
})
|
})
|
Loading…
Add table
Add a link
Reference in a new issue