mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-20 09:35:15 -04:00
TypeError: Cannot read properties of undefined (reading 'lastMessageId') #36
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @WlodekM on GitHub (May 26, 2024).
What happened?
my bot crashes when i use the kick command
Full error:
kick command code:
it gets to the
client.channels.get("01H8A1BFF1F2Q2AT6629WC6A4Q").sendMessage(`${killers.random()}${weepons.random()}${message.args[0]}`)part before crashingpls help
@amycatgirl commented on GitHub (Sep 22, 2024):
I've already explained my findings inside the Revolt server, but in summary:
ServerMemberLeaveandServerDeleteServerDeletewas received, the client deletes the server and it's channels from their respective collectionslastMessageIdpropertyThis is the code that deletes the channels.
My suggestion to this issue, for the time being, is commenting out this piece of code until
ServerDeletecan tell the client that the event is a leave or a delete on the client's end.@insertish commented on GitHub (Oct 16, 2024):
Does "client receives" imply the bot is receiving the
ServerDeletefor the member?I was noticing some strange behaviour with member leaves, this might be a backend bug.
Also, https://github.com/revoltchat/backend/releases/tag/20240710-1 includes a change that adds the
reasontoServerMemberLeave.