Skip to content

Chapter 1: Goal and preparation

In this use case you’ll build a Telegram bot that manages a products table in Airtable. Any registered user will be able to look it up, but only those with permission will be able to create, change or delete products. The bot checks who is writing and which permission they have on every message.

This is an advanced case: it’s best to do the email and calendar assistant first.

How it works

  1. A user writes to the bot.
  2. The flow looks that user up in an Airtable table and reads their name and permission.
  3. An agent receives the message together with that data and decides what to do in the products table.
  4. The bot replies to the user on Telegram.

Prepare the Airtable base

Create a base with two tables:

Users

FieldTypeWhat for
UsernameTextThe name the bot uses to address the person.
chatidNumberThe person’s Telegram identifier.
Admin permissionsCheckboxTicked if the person can change products.

Products

FieldType
Product nameText
StockNumber

Add any other fields you want to manage.

Prepare the credentials

In Credentials, create these three. See Credentials.

ServiceExample nameWhat to fill in
Telegram bot APIInventory botThe bot’s token in Telegram bot token. BotFather gives it to you when you create the bot.
Airtable APIInventory AirtableYour Airtable personal access token in Access Token, with access to the base you created.
Google GeminiGeminiYour Gemini key in Google Api Key.

In the next chapter you’ll build the part that identifies the user.