mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor(actions): use optional chaining (#7460)
This commit is contained in:
@@ -23,7 +23,7 @@ class MessageReactionAdd extends Action {
|
||||
|
||||
// Verify channel
|
||||
const channel = this.getChannel(data);
|
||||
if (!channel || !channel.isTextBased()) return false;
|
||||
if (!channel?.isTextBased()) return false;
|
||||
|
||||
// Verify message
|
||||
const message = this.getMessage(data, channel);
|
||||
|
||||
@@ -20,7 +20,7 @@ class MessageReactionRemove extends Action {
|
||||
|
||||
// Verify channel
|
||||
const channel = this.getChannel(data);
|
||||
if (!channel || !channel.isTextBased()) return false;
|
||||
if (!channel?.isTextBased()) return false;
|
||||
|
||||
// Verify message
|
||||
const message = this.getMessage(data, channel);
|
||||
|
||||
@@ -7,7 +7,7 @@ class MessageReactionRemoveAll extends Action {
|
||||
handle(data) {
|
||||
// Verify channel
|
||||
const channel = this.getChannel(data);
|
||||
if (!channel || !channel.isTextBased()) return false;
|
||||
if (!channel?.isTextBased()) return false;
|
||||
|
||||
// Verify message
|
||||
const message = this.getMessage(data, channel);
|
||||
|
||||
@@ -6,7 +6,7 @@ const Events = require('../../util/Events');
|
||||
class MessageReactionRemoveEmoji extends Action {
|
||||
handle(data) {
|
||||
const channel = this.getChannel(data);
|
||||
if (!channel || !channel.isTextBased()) return false;
|
||||
if (!channel?.isTextBased()) return false;
|
||||
|
||||
const message = this.getMessage(data, channel);
|
||||
if (!message) return false;
|
||||
|
||||
Reference in New Issue
Block a user