1 parent
d8ffd3e543
commit
fc25df8104
1 file changed
+4
-1
@@ -1768,7 +1768,10 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
|
||||
public async channelsList(query: ListChannelsQuery): Promise<Channel[]> {
|
||||
const newsletters = await this.sock.newsletterSubscribed();
|
||||
let channels = newsletters.map(toNewsletterMetadata).map(this.toChannel);
|
||||
let channels = newsletters
|
||||
.map(toNewsletterMetadata)
|
||||
.filter(Boolean)
|
||||
.map(this.toChannel);
|
||||
if (query.role) {
|
||||
// @ts-ignore
|
||||
channels = channels.filter((channel) => channel.role === query.role);
|
||||
|
||||
Reference in new issue
Block a user