mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-10 15:13:04 -04:00
add loading state gif to bard
This commit is contained in:
parent
29399b586e
commit
9b64f7eac9
4 changed files with 25 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
const { COLORS } = require('../constants')
|
||||
const { STATIC_ICONS, STATICS } = require('./statics')
|
||||
const { STATIC_ICONS, STATICS, STATIC_ASSETS } = require('./statics')
|
||||
|
||||
const embedTypes = Object.freeze({
|
||||
"default": (context) => {
|
||||
|
@ -92,7 +92,10 @@ const embedTypes = Object.freeze({
|
|||
return {
|
||||
author: {
|
||||
iconUrl: STATIC_ICONS.ai_bard,
|
||||
name: `Generating`
|
||||
name: ``
|
||||
},
|
||||
image: {
|
||||
url: STATIC_ASSETS.chat_loading
|
||||
},
|
||||
color: COLORS.embed
|
||||
}
|
||||
|
@ -105,7 +108,7 @@ module.exports.createEmbed = function(type, context, content){
|
|||
if(!content) embedTypes[type](context)
|
||||
let emb = embedTypes[type](context)
|
||||
|
||||
if(["success","warning","error","loading","ai","ai_bard"].includes(type)){
|
||||
if(["success","warning","error","loading","ai"].includes(type)){
|
||||
emb.author.name = content
|
||||
return emb
|
||||
}
|
||||
|
|
|
@ -3,6 +3,16 @@ const { Hosts } = require('../api/endpoints')
|
|||
// Add static brand icons here
|
||||
// Update the revision id to break discord cache
|
||||
const Statics = Object.freeze({
|
||||
assets: {
|
||||
chat_loading: {
|
||||
file: "loading/02_chat_loading.47madop37as0.gif",
|
||||
revision: 0
|
||||
},
|
||||
embed_invite_spacer: {
|
||||
file: "misc/embed-spacer-botinvite.png",
|
||||
revision: 0
|
||||
},
|
||||
},
|
||||
brands: {
|
||||
applemaps: {
|
||||
file: "brands/applemaps.png",
|
||||
|
@ -161,11 +171,7 @@ module.exports.STATICS = Object.freeze({
|
|||
wikihow: staticAsset(Statics.brands.wikihow),
|
||||
wikipedia: staticAsset(Statics.brands.wikipedia),
|
||||
wolframalpha: staticAsset(Statics.brands.wolframalpha),
|
||||
youtube: staticAsset(Statics.brands.youtube),
|
||||
embedSpacerInvite: staticAsset({
|
||||
file: "misc/embed-spacer-botinvite.png",
|
||||
revision: 0
|
||||
})
|
||||
youtube: staticAsset(Statics.brands.youtube)
|
||||
})
|
||||
|
||||
module.exports.STATIC_ICONS = Object.freeze({
|
||||
|
@ -176,4 +182,9 @@ module.exports.STATIC_ICONS = Object.freeze({
|
|||
ai_bard: staticAsset(Statics.icons.ai_bard),
|
||||
ai_bard_idle: staticAsset(Statics.icons.ai_bard_idle),
|
||||
warning: staticAsset(Statics.icons.warning)
|
||||
})
|
||||
|
||||
module.exports.STATIC_ASSETS = Object.freeze({
|
||||
chat_loading: staticAsset(Statics.assets.chat_loading),
|
||||
embed_invite_spacer: staticAsset(Statics.assets.embed_invite_spacer)
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue