Documentation
¶
Index ¶
- Variables
- func CommandRegister(cmdName string, handler func(Message))
- func MessageRegister(callback func(Message))
- func NoticeRegister(noticeType string, handler func(Message))
- func RandomString(length int) string
- func SendApi(apiName string, data []byte, selfId int64) []byte
- func SendApiEcho(apiName string, data []byte, echo any, selfId int64) []byte
- func SendMessage[T string | []MessageItem](msg T, userId int64, groupId int64, selfId int64) (messageId []int)
- func SendOperator(target, operator string, args []string)
- func SendPoke(userId int64, groupId int64, selfId int64)
- type Message
- type MessageItem
- type SafeMap
Constants ¶
This section is empty.
Variables ¶
View Source
var MessageChan chan Message
View Source
var OperatorMap map[string]func(Message)
Functions ¶
func CommandRegister ¶
func MessageRegister ¶
func MessageRegister(callback func(Message))
func NoticeRegister ¶
func RandomString ¶
func SendApiEcho ¶ added in v0.2.1
func SendMessage ¶
func SendOperator ¶ added in v0.1.3
Types ¶
type Message ¶
type Message struct {
Time int64 `json:"time"`
SelfId int64 `json:"self_id"`
PostType string `json:"post_type"`
UserId int64 `json:"user_id"`
GroupId int64 `json:"group_id"`
GroupName string `json:"group_name"`
Font int `json:"font"`
RealSeq string `json:"real_seq"`
MessageSeq int `json:"message_seq"`
MessageType string `json:"message_type"`
SubType string `json:"sub_type"`
MessageId int64 `json:"message_id"`
MessageArray []MessageItem `json:"message"`
MessageFormat string `json:"message_format"`
RawMessage string `json:"raw_message"`
Sender struct {
UserId int64 `json:"user_id"`
NickName string `json:"nickname"`
Sex string `json:"sex"`
GroupId int64 `json:"group_id"`
Card string `json:"card"`
Role string `json:"role"`
} `json:"sender"`
NoticeType string `json:"notice_type"`
TargetId int64 `json:"target_id"`
TempSource string `json:"temp_source"`
MetaEventType string `json:"meta_event_type"`
RequestType string `json:"request_type"`
Comment string `json:"comment"`
Flag string `json:"flag"`
AtMe bool `json:"at_me"`
CommandArgs []string `json:"command_args"`
}
type MessageItem ¶
func (*MessageItem) GetNumber ¶ added in v0.1.1
func (item *MessageItem) GetNumber(name string) int
func (*MessageItem) GetString ¶ added in v0.1.1
func (item *MessageItem) GetString(name string) string
func (*MessageItem) Set ¶
func (item *MessageItem) Set(name string, value any)
Click to show internal directories.
Click to hide internal directories.