From e86ae655160f648398592a268311066da1513d6e Mon Sep 17 00:00:00 2001 From: BoyChai <1972567225@qq.com> Date: Tue, 23 Aug 2022 16:04:45 +0800 Subject: [PATCH] Docking channel event reporting information --- event.go | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/event.go b/event.go index a9b38df..354b93c 100644 --- a/event.go +++ b/event.go @@ -30,6 +30,8 @@ type Event struct { Level string `json:"level"` Role string `json:"role"` Title string `json:"title"` + //频道 + TinyID string `json:"tiny_id"` } `json:"sender"` Anonymous struct { ID int64 `json:"id"` @@ -60,11 +62,44 @@ type Event struct { Comment string `json:"comment"` Flag string `json:"flag"` Client struct { - AppId int64 `json:"app_id"` + AppID int64 `json:"app_id"` DeviceName string `json:"device_name"` DeviceKind string `json:"device_kind"` } `json:"client"` Online bool `json:"online"` + //频道 + GuildID string `json:"guild_id"` + ChannelID string `json:"channel_id"` + CurrentReactions []struct { + EmojiID string `json:"emoji_id"` + EmojiIndex int32 `json:"emoji_index"` + EmojiType int32 `json:"emoji_type"` + EmojiName string `json:"emoji_name"` + Count int32 `json:"count"` + Clicked bool `json:"clicked"` + } `json:"current_reactions"` + OldInfo ChannelInfo `json:"old_info"` + NewInfo ChannelInfo `json:"new_info"` + ChannelInfo ChannelInfo `json:"channel_info"` +} + +// ChannelInfo 频道信息 +type ChannelInfo struct { + OwnerGuildID string `json:"owner_guild_id"` + ChannelID string `json:"channel_id"` + ChannelType int32 `json:"channel_type"` + ChannelName string `json:"channel_name"` + CreateTime int64 `json:"create_time"` + CreatorTinyID string `json:"creator_tiny_id"` + TalkPermission int32 `json:"talk_permission"` + VisibleType int32 `json:"visible_type"` + CurrentSlowMode int32 `json:"current_slow_mode"` + SlowModes []struct { + SlowModeKey int32 `json:"slow_mode_key"` + SlowModeText string `json:"slow_mode_text"` + SpeakFrequency int32 `json:"speak_frequency"` + SlowModeCircle int32 `json:"slow_mode_circle"` + } `json:"slow_modes"` } // explain 解析命令函数 @@ -120,6 +155,8 @@ func (e *Event) typeAsserts(key interface{}) (interface{}, error) { return *key.(*int64), nil case *string: return *key.(*string), nil + case *int32: + return *key.(*int32), nil default: return nil, errors.New("the current type is not supported. please feedback through issue") }