GramIO API Reference / gramio/dist / BotOptions
Interface: BotOptions
Defined in: gramio/index.d.ts:832
Bot options that you can provide to Bot constructor
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
api | object | Options to configure how to send requests to the Telegram Bot API | gramio/index.d.ts:850 |
api.baseURL | string | URL which will be used to send requests to. Default "https://api.telegram.org/bot" | gramio/index.d.ts:854 |
api.fetchOptions? | RequestInit | Configure fetch parameters | gramio/index.d.ts:852 |
api.retryGetUpdatesWait? | number | Time in milliseconds before calling getUpdates again Default 1000 | gramio/index.d.ts:867 |
api.useTest? | boolean | Should we send requests to test data center? The test environment is completely separate from the main environment, so you will need to create a new user account and a new bot with @BotFather. Documentation Default false | gramio/index.d.ts:862 |
files? | object | File download/serving options — mainly for a local Bot API server. Example const bot = new Bot(token, { api: { baseURL: "http://telegram-bot-api:8081/bot" }, files: { // bot.getFileLink() and ctx.download() resolve to this (token-less) URL baseURL: "http://telegram-bot-api:8080", }, }); | gramio/index.d.ts:883 |
files.baseURL? | string | Public base URL where the working dir is served (e.g. the bundled file server / nginx). Enables token-less Bot.getFileLink and source: "rewrite". | gramio/index.d.ts:891 |
files.localDir? | string | Working directory of the local Bot API server — the prefix of the absolute file_path it returns. Default "/var/lib/telegram-bot-api" | gramio/index.d.ts:887 |
files.mountDir? | string | Where that working dir is mounted on the bot's side (for source: "disk" when bot & server share a volume at a different path). Defaults to localDir. | gramio/index.d.ts:889 |
files.source? | FileSource | How to fetch file bytes. Default "auto" | gramio/index.d.ts:885 |
info? | TelegramUser | When the bot begins to listen for updates, GramIO retrieves information about the bot to verify if the bot token is valid and to utilize some bot metadata. For example, this metadata will be used to strip bot mentions in commands. If you set it up, GramIO will not send a getMe request on startup. Important You should set this up when horizontally scaling your bot or working in serverless environments. | gramio/index.d.ts:843 |
plugins? | object | List of plugins enabled by default | gramio/index.d.ts:845 |
plugins.format? | boolean | Pass false to disable plugin. Default true | gramio/index.d.ts:847 |
token | string | Bot token | gramio/index.d.ts:834 |