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
- A user writes to the bot.
- The flow looks that user up in an Airtable table and reads their name and permission.
- An agent receives the message together with that data and decides what to do in the products table.
- The bot replies to the user on Telegram.
Prepare the Airtable base
Create a base with two tables:
Users
| Field | Type | What for |
|---|---|---|
Username | Text | The name the bot uses to address the person. |
chatid | Number | The person’s Telegram identifier. |
Admin permissions | Checkbox | Ticked if the person can change products. |
Products
| Field | Type |
|---|---|
Product name | Text |
Stock | Number |
Add any other fields you want to manage.
Prepare the credentials
In Credentials, create these three. See Credentials.
| Service | Example name | What to fill in |
|---|---|---|
| Telegram bot API | Inventory bot | The bot’s token in Telegram bot token. BotFather gives it to you when you create the bot. |
| Airtable API | Inventory Airtable | Your Airtable personal access token in Access Token, with access to the base you created. |
| Google Gemini | Gemini | Your Gemini key in Google Api Key. |
In the next chapter you’ll build the part that identifies the user.