This commit is contained in:
NoLogicAlan committed 2026-05-12 23:18:42 +03:00
1 parent 4e1d23fd57
commit 0714d30a6f
5 files changed
+111 -100

No files matched your search

+10 -2
View File
@@ -500,7 +500,15 @@ export class Channel {
* @returns {Function}
*/
onMessageUser(callback, user) {
const oid = this.handler.observeUserMessagesChannel(user.id, this.channel, callback);
const resolvedUserId = user?.id
?? user?._id
?? user?.user?.id
?? null;
const resolvedChannel = this.channel ?? null;
if (!resolvedUserId || !resolvedChannel?.id) {
return () => {};
}
const oid = this.handler.observeUserMessagesChannel(resolvedUserId, resolvedChannel, callback);
return () => {
this.handler.unobserveUserMessagesChannel(oid);
};
@@ -1235,4 +1243,4 @@ export class HelpCommand {
paginator.send();
}
}
}