fix: update watch command help to bot api style id, close #151

This commit is contained in:
krau
2025-12-08 10:22:43 +08:00
parent c974791dc0
commit 32cc1e4b5a
4 changed files with 10 additions and 6 deletions

View File

@@ -34,7 +34,7 @@ func (m matchedStorName) String() string {
}
// can we use this storage name directly?
func (m matchedStorName) IsUsable() bool {
func (m matchedStorName) Usable() bool {
return m != "" && m != rule.RuleStorNameChosen
}

View File

@@ -41,7 +41,7 @@ func CreateAndAddTGFileTaskWithEdit(ctx *ext.Context, userID int64, stor storage
if matchedDirPath != "" {
dirPath = matchedDirPath.String()
}
if matchedStorageName.IsUsable() {
if matchedStorageName.Usable() {
stor, err = storage.GetStorageByUserIDAndName(ctx, user.ChatID, matchedStorageName.String())
if err != nil {
logger.Errorf("Failed to get storage by user ID and name: %s", err)
@@ -111,7 +111,7 @@ func CreateAndAddBatchTGFileTaskWithEdit(ctx *ext.Context, userID int64, stor st
return stor.Name(), ruleutil.MatchedDirPath(dirPath)
}
storname := storName.String()
if !storName.IsUsable() {
if !storName.Usable() {
storname = stor.Name()
}
return storname, dirP

View File

@@ -228,7 +228,7 @@ func listenMediaMessageEvent(ch chan userclient.MediaMessageEvent) {
goto startCreateTask
}
dirPath = matchedDirPath.String()
if matchedStorageName.IsUsable() {
if matchedStorageName.Usable() {
stor, err = storage.GetStorageByUserIDAndName(ctx, user.ChatID, matchedStorageName.String())
if err != nil {
logger.Errorf("Failed to get storage by user ID and name: %s", err)