1
0
mirror of https://github.com/fumiama/NanoBot.git synced 2026-06-07 03:30:24 +08:00

fix uid gid

This commit is contained in:
源文雨
2023-11-16 23:49:29 +09:00
parent 0beca59240
commit 41dff2d35f
2 changed files with 23 additions and 11 deletions

View File

@@ -285,8 +285,8 @@ func (ctx *Ctx) Break() {
ctx.ma.Break = true
}
// SenderID 唯一的发送者 ID
func (ctx *Ctx) SenderID() uint64 {
// GroupID 唯一的发送者所属组 ID
func (ctx *Ctx) GroupID() uint64 {
grp := uint64(0)
if ctx.IsQQ {
if OnlyQQGroup(ctx) {
@@ -305,3 +305,12 @@ func (ctx *Ctx) SenderID() uint64 {
}
return grp
}
// GroupID 唯一的发送者 ID
func (ctx *Ctx) UserID() uint64 {
if ctx.IsQQ {
return DigestID(ctx.Message.Author.ID)
}
grp, _ := strconv.ParseUint(ctx.Message.Author.ID, 10, 64)
return grp
}