feat(client): isGroup getter for Chat

This commit is contained in:
teidesu 2021-06-30 02:01:11 +03:00
parent 2220371efd
commit abbebeddf9

View file

@ -156,6 +156,21 @@ export class Chat {
return this._type! return this._type!
} }
/**
* Whether this chat is a group chat
* (i.e. not a channel and not PM)
*/
get isGroup(): boolean {
switch (this.type) {
case 'group':
case 'supergroup':
case 'gigagroup':
return true
}
return false
}
/** /**
* Whether this chat has been verified by Telegram. * Whether this chat has been verified by Telegram.
* Supergroups, channels and groups only * Supergroups, channels and groups only