为Message添加string方法

This commit is contained in:
eatmoreapple 2021-09-25 20:33:49 +08:00
parent 5cd4e2bb7e
commit 6b27887bc3
2 changed files with 1 additions and 2 deletions

View File

@ -39,7 +39,6 @@ func TestLogout(t *testing.T) {
func TestMessageHandle(t *testing.T) {
bot := DefaultBot(Desktop)
bot.MessageHandler = func(msg *Message) {
fmt.Println(msg)
if msg.IsText() && msg.Content == "ping" {
msg.ReplyText("pong")
}

View File

@ -649,5 +649,5 @@ func (m *Message) IsComeFromGroup() bool {
}
func (m *Message) String() string {
return fmt.Sprintf("<%s:ID:%s>", m.MsgType, m.MsgId)
return fmt.Sprintf("<%s:%s>", m.MsgType, m.MsgId)
}