diff --git a/guide/index.md b/guide/index.md index c652052..56b8ffe 100755 --- a/guide/index.md +++ b/guide/index.md @@ -91,6 +91,12 @@ await tg.start() deno run -A --unstable-ffi your-script.ts ``` +Deno is also supported in `@mtcute/create-bot`, which is only available in npm: + +```bash +deno run -A npm:@mtcute/create-bot my-awesome-bot +``` + ## Browser For browsers, it is recommended to use [vite](https://vitejs.dev). diff --git a/guide/topics/raw-api.md b/guide/topics/raw-api.md index 1ce1b13..e765015 100755 --- a/guide/topics/raw-api.md +++ b/guide/topics/raw-api.md @@ -178,3 +178,21 @@ If `FormattedString` is passed (e.g. md\`\*\*Hello!**\`), It returns a tuple containing text without any entities, and the entities themselves (if applicable). If `text` was not provided, empty string is returned. + +## Fully custom requests + +mtcute also allows you to send fully custom requests to the server. +This is useful if you want to use some undocumented or yet-unreleased APIs +and don't want to patch the library or use the TL schema override mechanism. + +You can use the `mtcute.customRequest` pseudo-method for that: + +```ts +const res = await tg.call({ + _: 'mtcute.customRequest', + bytes: Buffer.from('11223344', 'hex'), +}) +``` + +`bytes` will be send as-is to the server, and the response will be returned as a `Uint8Array` +for you to handle on your own (it might be useful to look into [`@mtcute/tl-runtime` package](https://ref.mtcute.dev/modules/_mtcute_tl_runtime.html))