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

@@ -1,12 +1,12 @@
'use strict';
const Action = require('./Action');
const { Events, VoiceBasedChannelTypes } = require('../../util/Constants');
const { Events } = require('../../util/Constants');
class MessageReactionRemoveEmoji extends Action {
handle(data) {
const channel = this.getChannel(data);
if (!channel || VoiceBasedChannelTypes.includes(channel.type)) return false;
if (!channel || !channel.isText()) return false;
const message = this.getMessage(data, channel);
if (!message) return false;