fix(client): removed "broadcast groups"

that was my misunderstanding of docs 🤷
This commit is contained in:
teidesu 2021-04-10 21:07:33 +03:00
parent 02975b3793
commit f81329eecf
2 changed files with 2 additions and 8 deletions

View file

@ -11,9 +11,8 @@ export namespace ChatPreview {
* - `group`: Legacy group
* - `supergroup`: Supergroup
* - `channel`: Broadcast channel
* - `broadcast`: Broadcast group
*/
export type Type = 'group' | 'supergroup' | 'channel' | 'broadcast'
export type Type = 'group' | 'supergroup' | 'channel'
}
export class ChatPreview {
@ -45,7 +44,6 @@ export class ChatPreview {
get type(): ChatPreview.Type {
if (!this.invite.channel) return 'group'
if (this.invite.broadcast) return 'channel'
if (this.invite.megagroup) return 'broadcast'
return 'supergroup'
}

View file

@ -15,7 +15,6 @@ export namespace Chat {
* - `group`: Legacy group
* - `supergroup`: Supergroup
* - `channel`: Broadcast channel
* - `broadcast`: Broadcast group
*/
export type Type =
| 'private'
@ -23,7 +22,6 @@ export namespace Chat {
| 'group'
| 'supergroup'
| 'channel'
| 'broadcast'
}
/**
@ -117,9 +115,7 @@ export class Chat {
} else if (this.peer._ === 'chat') {
this._type = 'group'
} else if (this.peer._ === 'channel') {
this._type = this.peer.megagroup
? 'broadcast'
: this.peer.broadcast
this._type = this.peer.broadcast
? 'channel'
: 'supergroup'
}