Skip to content

Commit 36e391e

Browse files
committed
docs: enhance Telegram Chat Surface Adapter tutorial with migration instructions for admin user schema
1 parent efbdccf commit 36e391e

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

adminforth/documentation/docs/tutorial/05-Adapters/09-chat-surface-adapters.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@ Add this field to your `adminuser` resource:
3737
},
3838
```
3939

40+
Also add the matching column to your database schema and run a migration. For example, with Prisma:
41+
42+
```prisma title="schema.prisma"
43+
model adminuser {
44+
// existing fields
45+
telegramId String?
46+
}
47+
```
48+
49+
Then create and apply the migration using your app's migration scripts:
50+
51+
```bash
52+
pnpm makemigration --name add-adminuser-telegram-id
53+
pnpm migrate:local
54+
```
55+
56+
After the migration, set `telegramId` on the admin user record to the numeric Telegram user id that should be allowed to use the bot.
57+
4058
If your field is named differently, configure `adminUserTelegramIdField` option (see below).
4159

4260
Register the adapter in the Agent plugin:

0 commit comments

Comments
 (0)