Type alias ClientResult<Method>

ClientResult<Method>: {
    ok: false;
} | {
    ok: true;
    result: MethodReturn<Method>;
}

A result of the client.request function.

Type Parameters

Type declaration

  • ok: false

Type declaration

Example

const response = await client.request("sendMessage", { chat_id: 123, text: "Hello" });

if (response.ok) {
console.log(response.result.message_id);
}