mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 08:14:47 +02:00
stopTyping
This commit is contained in:
@@ -233,11 +233,9 @@ client.on('messageCreate', async msg => {
|
|||||||
msg.channel.sendTyping().catch(() => null);
|
msg.channel.sendTyping().catch(() => null);
|
||||||
try {
|
try {
|
||||||
const response = await cleverbot.respond(msg.cleanContent);
|
const response = await cleverbot.respond(msg.cleanContent);
|
||||||
msg.channel.stopTyping(true);
|
|
||||||
await msg.channel.send(response);
|
await msg.channel.send(response);
|
||||||
return;
|
return;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
msg.channel.stopTyping(true);
|
|
||||||
if (err.status === 503) {
|
if (err.status === 503) {
|
||||||
await msg.channel.send('Monthly API limit reached. Ending conversation.');
|
await msg.channel.send('Monthly API limit reached. Ending conversation.');
|
||||||
client.cleverbots.delete(msg.channel.id);
|
client.cleverbots.delete(msg.channel.id);
|
||||||
|
|||||||
Reference in New Issue
Block a user