Update self-term

This commit is contained in:
Christopher Cookman 2023-03-10 10:30:39 -07:00
parent 8e244a203e
commit 23d989cd59
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -148,7 +148,10 @@ client.on('messageCreate', async (message) => {
}).then((data) => { }).then((data) => {
output = data.data.choices[0].message; output = data.data.choices[0].message;
output.name = "Bot"; 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); resetSession(message.channelId);
return message.channel.send(lang.terminated); return message.channel.send(lang.terminated);
} }