-
Couldn't load subscription status.
- Fork 124
Description
When updating a command so that the bot also needs to rewrite the command output, I get a deprecation message:
DeprecationWarning: Message#deleted is deprecated, see discordjs/discord.js#7091.
When looking a bit deeper I was able to get the stack trace, where I found what triggered it:
discord.js/src/structures/Message.js:362
and also the offending code, located at:
discord-akairo/src/struct/commands/CommandUtil.js:103, inside CommandUtil#send:
if (this.shouldEdit && (this.command ? this.command.editable : true) && !hasFiles && !this.lastResponse.deleted && !this.lastResponse.attachments.size) {
The actual problem being this.lastResponse.deleted.
I have read the discord.js issue, and since it is already merged this will need to get fixed before upgrading to discord.js v14. The issue also mentions a counterpart to the deprecated function: Message#detelable, and if I look into the code they actually do the same check (of course deletable returns the opposite from deleted):
get deleted():
return deletedMessages.has(this);
get deletable():
if (deletedMessages.has(this)) {
return false;
}
PR with required changes: #253