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:
13
context.go
13
context.go
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user