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

Closed
opened 2026-02-16 12:26:48 -05:00 by yindo · 3 comments
Owner

Originally created by @ghost on GitHub (Apr 17, 2023).

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

Originally created by @ghost on GitHub (Apr 17, 2023). ### 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: ```ts /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](https://github.com/stationaryStation/stationbot-revolt/blob/a00f2c6387aeab880eda57b9ab420fdcb8c81ef3/packages/base/src/commands/fun/boop.ts) 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
yindo added the bug label 2026-02-16 12:26:48 -05:00
yindo closed this issue 2026-02-16 12:26:48 -05:00
Author
Owner

@ghost commented on GitHub (Apr 26, 2023):

Issue persists in revolt.js 7.0.0-beta.4

@ghost commented on GitHub (Apr 26, 2023): Issue persists in revolt.js 7.0.0-beta.4
Author
Owner

@MagnusHJensen commented on GitHub (May 23, 2023):

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

@MagnusHJensen commented on GitHub (May 23, 2023): Can't reproduce on revolt.js 7.0.0-beta.6. (_Built locally_)
Author
Owner

@insertish commented on GitHub (Mar 28, 2024):

Assuming this was fixed.

@insertish commented on GitHub (Mar 28, 2024): Assuming this was fixed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/javascript-client-sdk#24