feat: sync AI compose and ChatBot features

This commit is contained in:
A 2026-07-03 19:43:20 +08:00
parent 35e5d38f4d
commit b7269b135f
75 changed files with 5426 additions and 123 deletions

View file

@ -61,6 +61,7 @@ func NewBotStore(users *UserStore) *BotStore {
}
s.byID[domain.BotFatherUserID] = botFatherSeedProfile()
s.byID[domain.StickersBotUserID] = stickersSeedProfile()
s.byID[domain.ChatBotUserID] = chatBotSeedProfile()
return s
}
@ -99,6 +100,19 @@ func stickersSeedProfile() domain.BotProfile {
}
}
func chatBotSeedProfile() domain.BotProfile {
return domain.BotProfile{
BotUserID: domain.ChatBotUserID,
OwnerUserID: domain.ChatBotUserID,
Description: "Chat with the configured telesrv AI provider.",
Commands: []domain.BotCommand{
{Command: "start", Description: "start chatting"},
{Command: "help", Description: "show help"},
{Command: "reset", Description: "clear local chat context"},
},
}
}
func (s *BotStore) CreateBotAccount(ctx context.Context, user domain.User, profile domain.BotProfile) (domain.User, domain.BotProfile, error) {
user.Phone = ""
user.Username = strings.TrimSpace(strings.TrimPrefix(user.Username, "@"))