mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-08 22:23:03 -04:00
update design, add bard word filter
This commit is contained in:
parent
32ef0811ab
commit
fb2d4dbb37
4 changed files with 18 additions and 5 deletions
|
@ -9,6 +9,8 @@ const { iconPill, smallIconPill, icon } = require('../../../labscore/utils/markd
|
|||
|
||||
const { Permissions } = require("detritus-client/lib/constants");
|
||||
|
||||
const BLOCKED_PHRASES = process.env.BARD_BLOCKLIST.split(';')
|
||||
|
||||
module.exports = {
|
||||
name: 'bard',
|
||||
label: 'text',
|
||||
|
@ -32,11 +34,13 @@ module.exports = {
|
|||
|
||||
let input = args.text;
|
||||
|
||||
for(const p of BLOCKED_PHRASES) if(input.toLowerCase().includes(p)) return await editOrReply(context, createEmbed("error", context, "Query includes blocked phrases. This incident will be reported."));
|
||||
|
||||
let inputDisplay = args.text.replace(/\n/g, ' ')
|
||||
if(inputDisplay.length >= 50) inputDisplay = inputDisplay.substr(0,50) + '...'
|
||||
|
||||
try{
|
||||
await editOrReply(context, createEmbed("ai_bard", context, inputDisplay))
|
||||
await editOrReply(context, createEmbed("ai_custom", context, STATIC_ICONS.ai_bard))
|
||||
|
||||
let res = await superagent.post(`${process.env.AI_SERVER}/google/bard`)
|
||||
.set({
|
||||
|
|
|
@ -57,7 +57,7 @@ module.exports = {
|
|||
if(inputDisplay.length >= 50) inputDisplay = inputDisplay.substr(0,50) + '...'
|
||||
|
||||
try{
|
||||
await editOrReply(context, createEmbed("ai_bard", context, inputDisplay))
|
||||
await editOrReply(context, createEmbed("ai_custom", context, STATIC_ICONS.ai_palm_idle))
|
||||
|
||||
let res = await superagent.post(`${process.env.AI_SERVER}/google/palm2`)
|
||||
.set({
|
||||
|
@ -87,7 +87,7 @@ module.exports = {
|
|||
embeds:[createEmbed("defaultNoFooter", context, {
|
||||
author: {
|
||||
name: inputDisplay,
|
||||
iconUrl: STATIC_ICONS.ai_bard_idle
|
||||
iconUrl: STATIC_ICONS.ai_palm_idle
|
||||
},
|
||||
description: description.join('\n'),
|
||||
footer: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue