mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 21:43:33 +01:00
fix(InteractionResponses): do not use in if a string is passed
This commit is contained in:
@@ -162,7 +162,8 @@ class InteractionResponses {
|
||||
async reply(options) {
|
||||
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
||||
|
||||
if ('ephemeral' in options) {
|
||||
if (typeof options !== 'string') {
|
||||
if ('fetchReply' in options) {
|
||||
if (!deprecationEmittedForEphemeralOption) {
|
||||
process.emitWarning(
|
||||
`Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead.`,
|
||||
@@ -182,6 +183,7 @@ class InteractionResponses {
|
||||
deprecationEmittedForFetchReplyOption = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let messagePayload;
|
||||
if (options instanceof MessagePayload) messagePayload = options;
|
||||
@@ -331,7 +333,7 @@ class InteractionResponses {
|
||||
async update(options) {
|
||||
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
||||
|
||||
if ('fetchReply' in options) {
|
||||
if (typeof options !== 'string' && 'fetchReply' in options) {
|
||||
if (!deprecationEmittedForFetchReplyOption) {
|
||||
process.emitWarning(
|
||||
// eslint-disable-next-line max-len
|
||||
|
||||
Reference in New Issue
Block a user