# Set chat permissions

To set chat permissions, you can use **ChatPermissions class-method** or `.setChatPermissions` **answer/api method**

{% hint style="info" %}
ChatPermissions class-method or .setChatPermissions takes argument: [permissions](https://core.telegram.org/bots/api#chatpermissions) you want to set

If you want to know what arguments an API method takes, see the IDE hint

`NestgramDefault.chatPermissions` is chat permissions by default
{% endhint %}

{% code title="app.controller.ts" %}

```typescript
import { Controller, OnCommand, ChatPermissions, NestgramDefault } from 'nestgram';
import { AppService } from './app.service';

@Controller()
export class AppController {
  constructor(private readonly appService: AppService) {}

  @OnCommand('admin_chat_permissions')
  updateChatPermissions(): ChatPermissions {
    return new ChatPermissions({
      ...NestgramDefault.chatPermissions,
      can_send_polls: false,
      can_invite_users: false,
    }).next('Chat permissions updated!');
  }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://degreetpro.gitbook.io/nestgram/api-reference/set-chat-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
