Skip to content

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

PropertyTypeDescriptionDefined in
apiobjectOptions to configure how to send requests to the Telegram Bot APIgramio/index.d.ts:850
api.baseURLstringURL which will be used to send requests to. Default "https://api.telegram.org/bot"gramio/index.d.ts:854
api.fetchOptions?RequestInitConfigure fetch parametersgramio/index.d.ts:852
api.retryGetUpdatesWait?numberTime in milliseconds before calling getUpdates again Default 1000gramio/index.d.ts:867
api.useTest?booleanShould 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 falsegramio/index.d.ts:862
files?objectFile 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?stringPublic 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?stringWorking 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?stringWhere 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?FileSourceHow to fetch file bytes. Default "auto"gramio/index.d.ts:885
info?TelegramUserWhen 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?objectList of plugins enabled by defaultgramio/index.d.ts:845
plugins.format?booleanPass false to disable plugin. Default truegramio/index.d.ts:847
tokenstringBot tokengramio/index.d.ts:834