format User display
This commit is contained in:
parent
326f200976
commit
e171c1fefa
12
user.go
12
user.go
@ -54,7 +54,17 @@ type User struct {
|
|||||||
|
|
||||||
// implement fmt.Stringer
|
// implement fmt.Stringer
|
||||||
func (u *User) String() string {
|
func (u *User) String() string {
|
||||||
return fmt.Sprintf("<User:%s>", u.NickName)
|
format := "User"
|
||||||
|
if u.IsFriend() {
|
||||||
|
format = "Friend"
|
||||||
|
} else if u.IsGroup() {
|
||||||
|
format = "Group"
|
||||||
|
} else if u.IsMP() {
|
||||||
|
format = "MP"
|
||||||
|
} else if u.IsSelf() {
|
||||||
|
format = "Self"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("<%s:%s>", format, u.NickName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAvatarResponse 获取用户头像
|
// GetAvatarResponse 获取用户头像
|
||||||
|
Loading…
x
Reference in New Issue
Block a user