fix: assert channel types in message actions (#6919)

This commit is contained in:
SpaceEEC
2021-11-01 18:40:19 +01:00
committed by GitHub
parent 95d2a4d35e
commit 9bd3689fb1
9 changed files with 18 additions and 10 deletions

View File

@@ -10,6 +10,8 @@ class MessageCreateAction extends Action {
const client = this.client;
const channel = this.getChannel(data);
if (channel) {
if (!channel.isText()) return {};
const existing = channel.messages.cache.get(data.id);
if (existing) return { message: existing };
const message = channel.messages._add(data);