mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
fix(InteractionResponses): do not use in if a string is passed
This commit is contained in:
@@ -162,24 +162,26 @@ class InteractionResponses {
|
|||||||
async reply(options) {
|
async reply(options) {
|
||||||
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
||||||
|
|
||||||
if ('ephemeral' in options) {
|
if (typeof options !== 'string') {
|
||||||
if (!deprecationEmittedForEphemeralOption) {
|
if ('fetchReply' in options) {
|
||||||
process.emitWarning(
|
if (!deprecationEmittedForEphemeralOption) {
|
||||||
`Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead.`,
|
process.emitWarning(
|
||||||
);
|
`Supplying "ephemeral" for interaction response options is deprecated. Utilize flags instead.`,
|
||||||
|
);
|
||||||
|
|
||||||
deprecationEmittedForEphemeralOption = true;
|
deprecationEmittedForEphemeralOption = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ('fetchReply' in options) {
|
if ('fetchReply' in options) {
|
||||||
if (!deprecationEmittedForFetchReplyOption) {
|
if (!deprecationEmittedForFetchReplyOption) {
|
||||||
process.emitWarning(
|
process.emitWarning(
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
`Supplying "fetchReply" for interaction response options is deprecated. Utilize "withResponse" instead or fetch the response after using the method.`,
|
`Supplying "fetchReply" for interaction response options is deprecated. Utilize "withResponse" instead or fetch the response after using the method.`,
|
||||||
);
|
);
|
||||||
|
|
||||||
deprecationEmittedForFetchReplyOption = true;
|
deprecationEmittedForFetchReplyOption = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +333,7 @@ class InteractionResponses {
|
|||||||
async update(options) {
|
async update(options) {
|
||||||
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
if (this.deferred || this.replied) throw new DiscordjsError(ErrorCodes.InteractionAlreadyReplied);
|
||||||
|
|
||||||
if ('fetchReply' in options) {
|
if (typeof options !== 'string' && 'fetchReply' in options) {
|
||||||
if (!deprecationEmittedForFetchReplyOption) {
|
if (!deprecationEmittedForFetchReplyOption) {
|
||||||
process.emitWarning(
|
process.emitWarning(
|
||||||
// eslint-disable-next-line max-len
|
// eslint-disable-next-line max-len
|
||||||
|
|||||||
Reference in New Issue
Block a user