mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-05-11 17:39:41 +08:00
refactor: improve error handling in getSelectStorageMarkup for user retrieval
This commit is contained in:
@@ -46,7 +46,7 @@ var storageHashName = map[string]string{}
|
|||||||
func getSelectStorageMarkup(userChatID int64, fileChatID, fileMessageID int) (*tg.ReplyInlineMarkup, error) {
|
func getSelectStorageMarkup(userChatID int64, fileChatID, fileMessageID int) (*tg.ReplyInlineMarkup, error) {
|
||||||
user, err := dao.GetUserByChatID(userChatID)
|
user, err := dao.GetUserByChatID(userChatID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("failed to get user by chat ID: %d, error: %w", userChatID, err)
|
||||||
}
|
}
|
||||||
storages := storage.GetUserStorages(user.ChatID)
|
storages := storage.GetUserStorages(user.ChatID)
|
||||||
if len(storages) == 0 {
|
if len(storages) == 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user