Ingest and gossip VOICE_NOTE_CREATE mesh payloads.
Persist voice note metadata rows and broadcast create events on guild mesh. Co-authored-by: Cursor <[email protected]>
This commit is contained in:
@@ -359,6 +359,11 @@ class PearcordGuild extends EventEmitter {
|
||||
this.emit('attachment', payload)
|
||||
}).catch(() => {})
|
||||
}
|
||||
if (method === RPC.VOICE_NOTE_CREATE) {
|
||||
this.db.insert(COLLECTIONS.VOICE_NOTES, payload).then(() => {
|
||||
this.emit('voice-note', payload)
|
||||
}).catch(() => {})
|
||||
}
|
||||
if (method === RPC.GUILD_UPDATE) {
|
||||
this.db.insert(COLLECTIONS.GUILDS, payload).then(() => {
|
||||
if (this.guild?.id === payload.id) this.guild = payload
|
||||
@@ -787,6 +792,10 @@ class PearcordGuild extends EventEmitter {
|
||||
broadcastGossip(this, RPC.ATTACHMENT_META, attachment)
|
||||
}
|
||||
|
||||
gossipVoiceNoteCreate (payload) {
|
||||
return broadcastGossip(this, RPC.VOICE_NOTE_CREATE, payload)
|
||||
}
|
||||
|
||||
gossipGuildUpdate (guild) {
|
||||
broadcastGossip(this, RPC.GUILD_UPDATE, guild)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user