From 23d989cd591d003d7085691e21fbb026e70d7974 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Fri, 10 Mar 2023 10:30:39 -0700 Subject: [PATCH] Update self-term --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e40fe0f..bb22fb3 100644 --- a/index.js +++ b/index.js @@ -148,7 +148,10 @@ client.on('messageCreate', async (message) => { }).then((data) => { output = data.data.choices[0].message; output.name = "Bot"; - if (output.content == "!!!TERM1234!!!") { // This can allow a self-termination command + if (output.content.endsWith("!!!TERM1234!!!")) { // This can allow a self-termination command + output.content = output.content.replace("!!!TERM1234!!!", ""); + clearInterval(typing); + message.channel.send(output.content); resetSession(message.channelId); return message.channel.send(lang.terminated); }