Get chat info, leave chat
You can get chat info: chat member count, chat info, chat admins, chat member and other
Last updated
You can get chat info: chat member count, chat info, chat admins, chat member and other
To get chat info, use .getChat answer/api method
.getChat answer/api method takes argument: chat id you want to get (optional in answer method, current chat id by default)
If you want to know what arguments an API method takes, see the IDE hint
Returns IChat on success
To get chat administrators, use .getChatAdmins answer/api method
.getChatAdmins answer/api method takes argument: chat id you want to get admins to (optional in answer method, current chat id by default)
If you want to know what arguments an API method takes, see the IDE hint
Returns array of ChatMember on success
To get chat member count, use .getChatMemberCount answer/api method
.getChatMemberCount answer/api method takes argument: chat id you want to get member count to (optional in answer method, current chat id by default)
If you want to know what arguments an API method takes, see the IDE hint
Returns number on success
To get chat member, use .getChatMember answer/api method
User id you want to get
Optional. Current user id by default
Chat id you want to get member to
Optional. Current chat id by default
You can read more about subscription checking here
If you want to know what arguments an API method takes, see the IDE hint
Returns ChatMember on success
You can leave chat using Leave class-method or .leave answer/api method
Leave class-method or .leave answer/api method takes argument: chat id you want to leave to as argument (optional in answer method, current chat id by default)
If you want to know what arguments an API method takes, see the IDE hint
Last updated
import { Controller, Leave, OnCommand } from 'nestgram';
import { AppService } from './app.service';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
@OnCommand('leave')
leaveChat() {
return new Leave();
}
}