Remove Bot User ID from Prompt (#48)

This commit is contained in:
Kevin Dang
2024-04-20 10:01:42 -07:00
committed by GitHub
parent 6a1d66fd36
commit 477567b05d
2 changed files with 21 additions and 4 deletions

16
src/utils/mentionClean.ts Normal file
View File

@@ -0,0 +1,16 @@
import Keys from "../keys.js"
/**
* Clean up the bot user_id so it only has the prompt
*
* Sample: <@CLIENT_ID> Hello
* - we want to remove <@CLIENT_ID>
* - replace function works well for this
*
* @param message
* @returns
*/
export function clean(message: string): string {
const cleanedMessage: string = message.replace(`<@${Keys.clientUid}>`, '').trim()
return cleanedMessage
}