为Message添加string方法
This commit is contained in:
parent
5cd4e2bb7e
commit
6b27887bc3
@ -39,7 +39,6 @@ func TestLogout(t *testing.T) {
|
|||||||
func TestMessageHandle(t *testing.T) {
|
func TestMessageHandle(t *testing.T) {
|
||||||
bot := DefaultBot(Desktop)
|
bot := DefaultBot(Desktop)
|
||||||
bot.MessageHandler = func(msg *Message) {
|
bot.MessageHandler = func(msg *Message) {
|
||||||
fmt.Println(msg)
|
|
||||||
if msg.IsText() && msg.Content == "ping" {
|
if msg.IsText() && msg.Content == "ping" {
|
||||||
msg.ReplyText("pong")
|
msg.ReplyText("pong")
|
||||||
}
|
}
|
||||||
|
@ -649,5 +649,5 @@ func (m *Message) IsComeFromGroup() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *Message) String() string {
|
func (m *Message) String() string {
|
||||||
return fmt.Sprintf("<%s:ID:%s>", m.MsgType, m.MsgId)
|
return fmt.Sprintf("<%s:%s>", m.MsgType, m.MsgId)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user