From e216fc7a8102e0311446b41633e030cd9edfd370 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Sat, 14 Jan 2017 11:31:52 -0600 Subject: [PATCH] stop spamming api, and kill typing when a guild isn't there anymore (#1096) --- src/client/actions/GuildDelete.js | 2 ++ src/structures/interface/TextBasedChannel.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/actions/GuildDelete.js b/src/client/actions/GuildDelete.js index 12142633f..56896b63b 100644 --- a/src/client/actions/GuildDelete.js +++ b/src/client/actions/GuildDelete.js @@ -12,6 +12,8 @@ class GuildDeleteAction extends Action { let guild = client.guilds.get(data.id); if (guild) { + for (const channel of guild.channels.values()) channel.stopTyping(true); + if (guild.available && data.unavailable) { // guild is unavailable guild.available = false; diff --git a/src/structures/interface/TextBasedChannel.js b/src/structures/interface/TextBasedChannel.js index c3e7c93e0..70d6747ef 100644 --- a/src/structures/interface/TextBasedChannel.js +++ b/src/structures/interface/TextBasedChannel.js @@ -250,7 +250,7 @@ class TextBasedChannel { count: count || 1, interval: this.client.setInterval(() => { this.client.rest.methods.sendTyping(this.id); - }, 4000), + }, 9000), }); this.client.rest.methods.sendTyping(this.id); } else {