login: add support for bot tokens

This commit is contained in:
Tulir Asokan
2025-12-06 21:08:46 +02:00
parent 48fed1c026
commit 10f1583da9
10 changed files with 158 additions and 24 deletions
+3
View File
@@ -185,6 +185,9 @@ func (t *TelegramClient) stopTakeout(ctx context.Context) error {
}
func (t *TelegramClient) FetchMessages(ctx context.Context, fetchParams bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error) {
if t.metadata.IsBot {
return nil, fmt.Errorf("bots cannot backfill messages")
}
log := zerolog.Ctx(ctx).With().Str("method", "FetchMessages").Logger()
ctx = log.WithContext(ctx)