revolt.js icon indicating copy to clipboard operation
revolt.js copied to clipboard

bug: Error deleting a message after bot sends DM to user

Open ghost opened this issue 2 years ago • 2 comments

What happened?

Revolt.js 7 seems to not handle deleting messages using message.delete() or channel.deleteMessages() correctly after a DM is sent.

Error message:

/home/dumpling/Documents/Code/stationbot/packages/revolt.js/lib/cjs/classes/Message.js:96
        return __classPrivateFieldGet(this, _Message_collection, "f").getUnderlyingObject(this.id).authorId;
                                                                                                  ^

TypeError: Cannot read properties of undefined (reading 'authorId')
    at get authorId [as authorId] (/home/dumpling/Documents/Code/stationbot/packages/revolt.js/lib/cjs/classes/Message.js:96:99)
    at Timeout._onTimeout (/home/dumpling/Documents/Code/stationbot/packages/base/dist/index.js:244:53)
    at listOnTimeout (node:internal/timers:564:17)
    at process.processTimers (node:internal/timers:507:7)

Node.js v18.7.0

Code is available here

Removing message.delete()/channel.deleteMessages() seems to fix the issue.

Currently using revolt.js 7.0.0-beta.1. Built locally.

EDIT: Add version information

ghost avatar Apr 17 '23 20:04 ghost

Issue persists in revolt.js 7.0.0-beta.4

ghost avatar Apr 26 '23 23:04 ghost

Can't reproduce on revolt.js 7.0.0-beta.6. (Built locally)

MagnusHJensen avatar May 23 '23 19:05 MagnusHJensen

Assuming this was fixed.

insertish avatar Mar 28 '24 14:03 insertish