# Available methods

## Friendly Methods VS Raw API Methods

GramJS provides two types of methods. friendly methods are a wrapper around Raw API ones that will take care of most things that need to be added manually if the Raw API counterpart was used.

&#x20;The signature also won't change between updates while Raw API methods are known to change constantly.&#x20;

So in short only use Raw API methods if you either there isn't a friendly method counterpart or you need more control over it

## Friendly Methods

You can access these methods using `client.method_name` . There isn't a list of them currently but since  GramJS uses TS they can be found easily. An example would be the send\_message method used like so

{% tabs %}
{% tab title="TypeScript" %}

```typescript
await client.sendMessage('me', { message: 'Hello!' })
```

{% endtab %}
{% endtabs %}

A full list of friendly methods will be added soon to the docs.

## Raw API Methods

Raw API methods are generated automatically from the .tl files which can be found in `tl/static/api.tl` these methods are generated on each run on Nodejs and are cached in the browser after the first run so make sure to delete the cache if you update the tl schema.&#x20;

Alongside the methods, a definition file is generated containing all the available methods and their signature.&#x20;

To use Raw methods you need to import {Api} first

{% tabs %}
{% tab title="TypeScript" %}

```typescript
import {Api} from "telegram";
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const {Api} = require("telegram");
```

{% endtab %}
{% endtabs %}

Then you'll need to create the request you want from it's class. All methods are classes that accept args relevant to their signatures. An example would be&#x20;

```typescript
const messageRequest = new Api.messages.SendMessage({peer: "me", message: "hello"})
```

Your IDE of choice should help you with the name of the args.&#x20;

Finally, to send the request you would need to use the `.invoke()` of client

```typescript
const result = await client.invoke(messageRequest)
```

The type of result is different depending on the sent request.&#x20;

A full list of methods will be coming soon to the docs for now you can console.log the variable to inspect it.


---

# 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://painor.gitbook.io/gramjs/getting-started/available-methods.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.
