mirror of
https://github.com/fumiama/NanoBot.git
synced 2026-06-08 04:00:23 +08:00
add log
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package nano
|
package nano
|
||||||
|
|
||||||
|
import "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
// DMS 私信会话对象
|
// DMS 私信会话对象
|
||||||
//
|
//
|
||||||
// https://bot.q.qq.com/wiki/develop/api/openapi/dms/model.html
|
// https://bot.q.qq.com/wiki/develop/api/openapi/dms/model.html
|
||||||
@@ -25,6 +27,7 @@ func (bot *Bot) CreatePrivateChat(guildid, userid string) (*DMS, error) {
|
|||||||
//
|
//
|
||||||
// - 私信的 guild_id 在创建私信会话时以及私信消息事件中获取
|
// - 私信的 guild_id 在创建私信会话时以及私信消息事件中获取
|
||||||
func (bot *Bot) PostMessageToUser(id string, content *MessagePost) (*Message, error) {
|
func (bot *Bot) PostMessageToUser(id string, content *MessagePost) (*Message, error) {
|
||||||
|
logrus.Infoln(getLogHeader(), "<= [私]频道:", id+",", content)
|
||||||
return bot.postMessageTo("/dms/"+id+"/messages", content)
|
return bot.postMessageTo("/dms/"+id+"/messages", content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ func (bot *Bot) postMessageTo(ep string, content *MessagePost) (*Message, error)
|
|||||||
//
|
//
|
||||||
// https://bot.q.qq.com/wiki/develop/api/openapi/message/post_messages.html
|
// https://bot.q.qq.com/wiki/develop/api/openapi/message/post_messages.html
|
||||||
func (bot *Bot) PostMessageToChannel(id string, content *MessagePost) (*Message, error) {
|
func (bot *Bot) PostMessageToChannel(id string, content *MessagePost) (*Message, error) {
|
||||||
logrus.Infoln(getLogHeader(), "<= 频道:", id+",", content)
|
logrus.Infoln(getLogHeader(), "<= [公]频道:", id+",", content)
|
||||||
return bot.postMessageTo("/channels/"+id+"/messages", content)
|
return bot.postMessageTo("/channels/"+id+"/messages", content)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user