2024-10-26 03:48:56 +08:00

23 lines
483 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package scoresaber
import (
"database/sql"
"errors"
"log"
"git.lxtend.com/qqbot/sqlite3"
)
func GetSSID(qqId string) (ssId string, err error) {
db := sqlite3.GetDB()
err = db.Get(&ssId, "SELECT ssid FROM ssBind WHERE qqid = ?", qqId)
if err != nil {
if err == sql.ErrNoRows {
return "", errors.New("未绑定ss账号输入\"绑定ss [ssId]\"绑定")
}
log.Println("查询 ssId 出错:", err)
return "", errors.New("查询 ssId 失败")
}
return ssId, nil
}