Documentation
¶
Index ¶
- Constants
- Variables
- type Admin
- type AllMessage
- type Anonymous
- type CommonMessage
- func (cm CommonMessage) All() iter.Seq2[string, json.RawMessage]
- func (cm CommonMessage) AtFirst() (*schema.At, error)
- func (cm CommonMessage) Ats() ([]schema.At, int)
- func (cm CommonMessage) FaceFirst() (*schema.Face, error)
- func (cm CommonMessage) Faces() ([]schema.Face, int)
- func (cm CommonMessage) File() (*schema.CommonFile, error)
- func (cm CommonMessage) FilterType(Type string) iter.Seq[json.RawMessage]
- func (cm CommonMessage) Id() int
- func (cm CommonMessage) ImageFirst() (*schema.Image, error)
- func (cm CommonMessage) Images() ([]schema.Image, int)
- func (em CommonMessage) Record() (*schema.Record, error)
- func (cm CommonMessage) Reply(replyer Replyer, text string) error
- func (cm CommonMessage) TextFirst() (*schema.Text, error)
- func (cm CommonMessage) Texts() ([]schema.Text, int)
- type Event
- type Eventer
- type File
- type FriendRequest
- type GroupBan
- type GroupDecrease
- type GroupFile
- type GroupIncrease
- type GroupMessage
- type GroupRecall
- type GroupRequest
- type HeartMeta
- type LifeMeta
- type Messager
- type Notify
- type PrivateAdd
- type PrivateMessage
- type PrivateRecall
- type Replyer
Constants ¶
View Source
const ( EVENT_MESSAGE = "message" EVENT_NOTICE = "notice" EVENT_REQUEST = "request" EVENT_META = "meta_event" )
Variables ¶
View Source
var ( ErrNoAvailable = errors.New("no replyer available") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type Admin ¶
type AllMessage ¶
type AllMessage struct {
CommonMessage
GroupId int64 `json:"group_id"`
Anonymous Anonymous `json:"anonymous"`
}
func (AllMessage) SessionKey ¶
func (am AllMessage) SessionKey() string
func (AllMessage) Type ¶
func (am AllMessage) Type() string
type CommonMessage ¶
type CommonMessage struct {
SubType string `json:"sub_type"`
MessageId int `json:"message_id"`
UserId int64 `json:"user_id"`
Messages []schema.Message `json:"message"`
RawMessage string `json:"raw_message"`
Font int `json:"font"`
Sender schema.Sender `json:"sender"`
}
func (CommonMessage) All ¶ added in v0.2.3
func (cm CommonMessage) All() iter.Seq2[string, json.RawMessage]
yield all messages use type and raw
func (CommonMessage) File ¶
func (cm CommonMessage) File() (*schema.CommonFile, error)
func (CommonMessage) FilterType ¶ added in v0.3.0
func (cm CommonMessage) FilterType(Type string) iter.Seq[json.RawMessage]
yield the rawMessage by type
func (CommonMessage) Id ¶
func (cm CommonMessage) Id() int
func (CommonMessage) ImageFirst ¶
func (cm CommonMessage) ImageFirst() (*schema.Image, error)
type FriendRequest ¶
type FriendRequest struct {
UserId int64 `json:"user_id"`
Comment string `json:"comment"`
Flag string `json:"flag"`
}
func (*FriendRequest) Reply ¶
func (fr *FriendRequest) Reply(replyer Replyer, approve bool, remark string) error
func (FriendRequest) Type ¶
func (fr FriendRequest) Type() string
type GroupBan ¶
type GroupDecrease ¶
type GroupDecrease struct {
SubType string `json:"sub_type"` // leave/kick/kick_me
GroupId int64 `json:"group_id"`
UserId int64 `json:"user_id"`
OperatorId int64 `json:"operator_id"`
}
func (GroupDecrease) Type ¶
func (en GroupDecrease) Type() string
type GroupFile ¶
type GroupIncrease ¶
type GroupIncrease struct {
SubType string `json:"sub_type"` // approve/invite
GroupId int64 `json:"group_id"`
UserId int64 `json:"user_id"`
OperatorId int64 `json:"operator_id"`
}
func (GroupIncrease) Type ¶
func (en GroupIncrease) Type() string
type GroupMessage ¶
type GroupMessage struct {
CommonMessage
GroupId int64 `json:"group_id"`
Anonymous Anonymous `json:"anonymous"`
}
func (GroupMessage) SessionKey ¶
func (gm GroupMessage) SessionKey() string
func (GroupMessage) Type ¶
func (gm GroupMessage) Type() string
type GroupRecall ¶
type GroupRecall struct {
GroupId int64 `json:"group_id"`
UserId int64 `json:"user_id"`
OperatorId int64 `json:"operator_id"`
MessageId int64 `json:"message_id"`
}
func (GroupRecall) Type ¶
func (en GroupRecall) Type() string
type GroupRequest ¶
type GroupRequest struct {
SubType string `json:"sub_type"` // add invite
GroupId int64 `json:"group_id"`
UserId int64 `json:"user_id"`
Comment string `json:"comment"`
Flag string `json:"flag"`
}
func (*GroupRequest) Reply ¶
func (gr *GroupRequest) Reply(replyer Replyer, approve bool, reason string) error
func (GroupRequest) Type ¶
func (gr GroupRequest) Type() string
type Notify ¶
type PrivateAdd ¶
type PrivateAdd struct {
UserId int64 `json:"user_id"`
}
func (PrivateAdd) Type ¶
func (en PrivateAdd) Type() string
type PrivateMessage ¶
type PrivateMessage struct {
CommonMessage
}
func (PrivateMessage) SessionKey ¶
func (pm PrivateMessage) SessionKey() string
func (PrivateMessage) Type ¶
func (pm PrivateMessage) Type() string
type PrivateRecall ¶
func (PrivateRecall) Type ¶
func (en PrivateRecall) Type() string
Click to show internal directories.
Click to hide internal directories.