init: 初始化仓库
This commit is contained in:
21
handler/echo/echo.go
Normal file
21
handler/echo/echo.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package echo
|
||||
|
||||
import (
|
||||
"git.lxtend.com/qqbot/handler"
|
||||
"git.lxtend.com/qqbot/model"
|
||||
)
|
||||
|
||||
func init() {
|
||||
handler.RegisterHandler("echo", echo)
|
||||
}
|
||||
|
||||
func echo(msg model.Message) (reply model.Reply) {
|
||||
if len(msg.Msg) <= 5 {
|
||||
return model.Reply{}
|
||||
}
|
||||
return model.Reply{
|
||||
ReplyMsg: msg.Msg[5:],
|
||||
ReferOriginMsg: true,
|
||||
FromMsg: msg,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user