Documentation
¶
Index ¶
- type AddQuickEmoticonData
- type AuditCallbackData
- type BotListenerAddQuickEmoticon
- type BotListenerAuditCallback
- type BotListenerCreateRobot
- type BotListenerDeleteRobot
- type BotListenerJoinVilla
- type BotListenerRawRequest
- type BotListenerSendMessage
- type CreateRobotData
- type DeleteRobotData
- type Event
- type EventAddQuickEmoticon
- type EventAuditCallback
- type EventBase
- type EventCreateRobot
- type EventDeleteRobot
- type EventJoinVilla
- type EventSendMessage
- type EventType
- type JoinVillaData
- type Robot
- type SendMessageData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddQuickEmoticonData ¶
type AuditCallbackData ¶
type BotListenerAddQuickEmoticon ¶
type BotListenerAddQuickEmoticon func(data EventAddQuickEmoticon)
type BotListenerAuditCallback ¶
type BotListenerAuditCallback func(data EventAuditCallback)
type BotListenerCreateRobot ¶
type BotListenerCreateRobot func(data EventCreateRobot)
type BotListenerDeleteRobot ¶
type BotListenerDeleteRobot func(data EventDeleteRobot)
type BotListenerJoinVilla ¶
type BotListenerJoinVilla func(data EventJoinVilla)
listeners for each event
type BotListenerRawRequest ¶ added in v0.4.0
raw request listener
type BotListenerSendMessage ¶
type BotListenerSendMessage func(data EventSendMessage)
type CreateRobotData ¶
type CreateRobotData struct {
VillaId uint64 `json:"villa_id"`
}
type DeleteRobotData ¶
type DeleteRobotData struct {
VillaId uint64 `json:"villa_id"`
}
type Event ¶
type Event struct {
Event struct {
EventBase
ExtendData struct {
EventData struct {
JoinVilla JoinVillaData `json:"JoinVilla,omitempty"`
SendMessage SendMessageData `json:"SendMessage,omitempty"`
CreateRobot CreateRobotData `json:"CreateRobot,omitempty"`
DeleteRobot DeleteRobotData `json:"DeleteRobot,omitempty"`
AddQuickEmoticon AddQuickEmoticonData `json:"AddQuickEmoticon,omitempty"`
AuditCallback AuditCallbackData `json:"AuditCallback,omitempty"`
} `json:"EventData"`
} `json:"extend_data"`
} `json:"event"`
Type string `json:"type,omitempty"` // for sdk reverse proxy packet handling
Sign string `json:"sign,omitempty"` // for sdk reverse proxy packet handling
}
type EventAddQuickEmoticon ¶
type EventAddQuickEmoticon struct {
EventBase
Data AddQuickEmoticonData
}
func Event2EventAddQuickEmoticon ¶
func Event2EventAddQuickEmoticon(event Event) EventAddQuickEmoticon
type EventAuditCallback ¶
type EventAuditCallback struct {
EventBase
Data AuditCallbackData
}
func Event2EventAuditCallback ¶
func Event2EventAuditCallback(event Event) EventAuditCallback
type EventCreateRobot ¶
type EventCreateRobot struct {
EventBase
Data CreateRobotData
}
func Event2EventCreateRobot ¶
func Event2EventCreateRobot(event Event) EventCreateRobot
type EventDeleteRobot ¶
type EventDeleteRobot struct {
EventBase
Data DeleteRobotData
}
func Event2EventDeleteRobot ¶
func Event2EventDeleteRobot(event Event) EventDeleteRobot
type EventJoinVilla ¶
type EventJoinVilla struct {
EventBase
Data JoinVillaData
}
func Event2EventJoinVilla ¶
func Event2EventJoinVilla(event Event) EventJoinVilla
type EventSendMessage ¶
type EventSendMessage struct {
EventBase
Data SendMessageData
// contains filtered or unexported fields
}
func Event2EventSendMessage ¶
func Event2EventSendMessage(event Event, api *apis.ApiBase) EventSendMessage
func (*EventSendMessage) GetContent ¶
func (e *EventSendMessage) GetContent(is_treat bool) string
获取消息内容,is_treat为true时,如果消息内容以/开头,则去掉/
func (*EventSendMessage) Reply ¶
func (e *EventSendMessage) Reply(msg ...string) (api_models.SendMessageModel, int, error)
在相应的房间回复消息 i.e. wrapper for api.SendMessage 使用内嵌格式发送消息,并自动处理内部Entity(<@xxx>为艾特机器人或用户,<@everyone>为艾特全体,<#xxx>为跳转房间,<$xxx>为跳转连接) 艾特用户会自动获取用户昵称,跳转房间会自动获取房间名称;艾特机器人会显示文字“机器人”,艾特全体会显示“全体成员”,跳转连接会显示链接自身 使用\< 和 \> 可转义 < 和 >,不会被解析为Entity
func (*EventSendMessage) ReplyCustomize ¶ added in v0.3.0
func (e *EventSendMessage) ReplyCustomize(msg api_models.MsgInputModel) (api_models.SendMessageModel, int, error)
在相应的房间回复消息 i.e. wrapper for api.SendMessageCustomize 使用models.NewMsg创建消息,然后使用models.SetText等方法加入内容,最后使用此函数发送
type JoinVillaData ¶
type SendMessageData ¶
type SendMessageData struct {
ContentRaw string `json:"content"`
Content struct {
Trace struct {
VisualRoomVersion string `json:"visual_room_version"`
AppVersion string `json:"app_version"`
ActionType uint8 `json:"action_type"`
BotMsgId string `json:"bot_msg_id"`
Client string `json:"client"`
Env string `json:"env"`
RongSdkVersion string `json:"rong_sdk_version"`
} `json:"trace"`
MentionedInfo struct {
MentionedContent string `json:"mentioned_content"`
UserIdList []string `json:"user_id_list"`
Type uint8 `json:"type"`
} `json:"mentioned_info"`
User struct {
PortraitUri string `json:"portrait_uri"`
Extra struct {
MemberRoles struct {
Name string `json:"name"`
Color string `json:"color"`
WebColor string `json:"web_color"`
RoleFontColor string `json:"role_font_color"`
RoleBgColor string `json:"role_bg_color"`
} `json:"member_roles"`
State interface{} `json:"state"`
} `json:"extra"`
Name string `json:"name"`
Alias string `json:"alias"`
Id string `json:"id"`
Portrait string `json:"portrait"`
} `json:"user"`
Content struct {
Images []struct {
Url string `json:"url"`
Size struct {
Width uint64 `json:"width"`
Height uint64 `json:"height"`
} `json:"size"`
FileSize uint64 `json:"file_size"`
} `json:"images"`
Entities []struct {
Offset uint8 `json:"offset"`
Length uint8 `json:"length"`
Entity struct {
Type string `json:"type"`
BotId string `json:"bot_id"`
} `json:"entity"`
} `json:"entities"`
Text string `json:"text"`
}
}
FromUserId uint64 `json:"from_user_id"`
SendAt uint64 `json:"send_at"`
ObjectName uint64 `json:"object_name"`
RoomId uint64 `json:"room_id"`
Nickname string `json:"nickname"`
MsgUid string `json:"msg_uid"`
BotMsgId string `json:"bot_msg_id"`
VillaId uint64 `json:"villa_id"`
}
Click to show internal directories.
Click to hide internal directories.