fix(dm): guard sendDmChannelInvite when contacts module is older

Fall back to dm.gossipDmChannelUpsert so open-dm works without a stale
pearcord-contacts copy missing sendDmChannelInvite.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Raven Scott
2026-05-25 00:42:55 -04:00
co-authored by Cursor
parent fb73037855
commit 1235c82607
+3 -1
View File
@@ -1035,8 +1035,10 @@ class PearcordPlatform extends EventEmitter {
}))
: false
const channel = await this.dm.openWithPeer({ peerUserId, peerDisplayName })
if (this.contacts) {
if (typeof this.contacts?.sendDmChannelInvite === 'function') {
await this.contacts.sendDmChannelInvite(peerUserId, channel).catch(() => {})
} else if (this.dm?.gossipDmChannelUpsert) {
this.dm.gossipDmChannelUpsert(channel)
}
this.messages.setChannel({ channelId: channel.id, guildId: DM_GUILD_ID })
this.activeChannelId = channel.id