Documentation
¶
Index ¶
- Constants
- type AssetResp
- type CardMessage
- type CardMessageReq
- type CardModule
- func NewCard(theme CardThemeType, size CardSize) *CardModule
- func NewComment(elements []CardModule) *CardModule
- func NewCountdownDay(endTime time.Time) *CardModule
- func NewCountdownHour(endTime *time.Time) *CardModule
- func NewCountdownSecond(startTime, endTime *time.Time) *CardModule
- func NewDivider() *CardModule
- func NewImage(src string) *CardModule
- func NewImageGroup(src []string) *CardModule
- func NewInvite(code string) *CardModule
- func NewKMarkdown(content string) *CardModule
- func NewMultiLinesKMarkdown(lines []string) *CardModule
- func NewRightImgKMarkdown(content, src string) *CardModule
- func NewText(content string) *CardModule
- func NewTextHeader(content string) *CardModule
- type CardSize
- type CardText
- type CardThemeType
- type Channel
- type ChannelEventType
- type ChannelInfo
- type ChannelListResp
- type ChannelResp
- type ChannelType
- type Event
- type EventType
- type ExitedChannel
- type GatewayInfo
- type GatewayResp
- type Guild
- type GuildInfo
- type GuildListResp
- type GuildResp
- type HelloPack
- type JoinedChannel
- type KookResponse
- type MessageBtnClick
- type MessageCreateReq
- type MessageCreateResp
- type MessageDeleteReq
- type MessageUpdateReq
- type NotifyType
- type PageMeta
- type Role
- type SelfExitedGuild
- type SelfJoinedGuild
- type Signal
- type SignalCode
- type SignalType
- type SystemExtra
- type User
- type UserExtra
- type UserUpdated
- type WebResult
Constants ¶
View Source
const ( ThemeTypeSecondary CardThemeType = "secondary" ThemeTypePrimary CardThemeType = "primary" ThemeTypeSuccess CardThemeType = "success" ThemeTypeDanger CardThemeType = "danger" ThemeTypeWarning CardThemeType = "warning" ThemeTypeInfo CardThemeType = "info" ThemeTypeNone CardThemeType = "none" SizeXs CardSize = "xs" SizeSm CardSize = "sm" SizeMd CardSize = "md" SizeLg CardSize = "lg" )
View Source
const StatusBan = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetResp ¶ added in v1.4.0
type AssetResp struct {
Url string `json:"url"`
}
===== Asset =====
type CardMessage ¶
type CardMessage CardModule
type CardModule ¶
type CardModule struct { Type string `json:"type"` Theme CardThemeType `json:"theme,omitempty"` Title string `json:"title,omitempty"` Text CardText `json:"text,omitempty"` Size CardSize `json:"size,omitempty"` Modules []CardModule `json:"modules,omitempty"` Fields []CardModule `json:"fields,omitempty"` Elements []CardModule `json:"elements,omitempty"` Content string `json:"content,omitempty"` Mode string `json:"mode,omitempty"` Accessory *CardModule `json:"accessory,omitempty"` Value string `json:"value,omitempty"` Cover string `json:"cover,omitempty"` Click string `json:"click,omitempty"` Code string `json:"code,omitempty"` Circle bool `json:"circle,omitempty"` Src string `json:"src,omitempty"` StartTime int64 `json:"startTime,omitempty"` EndTime int64 `json:"endTime,omitempty"` }
func NewCard ¶
func NewCard(theme CardThemeType, size CardSize) *CardModule
func NewComment ¶
func NewComment(elements []CardModule) *CardModule
func NewCountdownDay ¶
func NewCountdownDay(endTime time.Time) *CardModule
func NewCountdownHour ¶
func NewCountdownHour(endTime *time.Time) *CardModule
func NewCountdownSecond ¶
func NewCountdownSecond(startTime, endTime *time.Time) *CardModule
func NewDivider ¶
func NewDivider() *CardModule
func NewImage ¶
func NewImage(src string) *CardModule
func NewImageGroup ¶
func NewImageGroup(src []string) *CardModule
func NewInvite ¶ added in v1.5.0
func NewInvite(code string) *CardModule
func NewKMarkdown ¶
func NewKMarkdown(content string) *CardModule
func NewMultiLinesKMarkdown ¶
func NewMultiLinesKMarkdown(lines []string) *CardModule
func NewRightImgKMarkdown ¶
func NewRightImgKMarkdown(content, src string) *CardModule
func NewText ¶
func NewText(content string) *CardModule
func NewTextHeader ¶
func NewTextHeader(content string) *CardModule
type CardThemeType ¶
type CardThemeType string
type Channel ¶
type Channel struct { Id string `json:"id"` Name string `json:"name"` UserId string `json:"user_id"` GuildId string `json:"guild_id"` Topic string `json:"topic"` IsCategory bool `json:"is_category"` ParentId string `json:"parent_id"` Level int `json:"level"` SlowMode int `json:"slow_mode"` Type ChannelType `json:"type"` PermissionOverwrites []any `json:"permission_overwrites"` PermissionUsers []any `json:"permission_users"` PermissionSync int `json:"permission_sync"` HasPassword bool `json:"has_password"` }
type ChannelEventType ¶
type ChannelEventType string
const ( ChannelEventTypeGroup ChannelEventType = "GROUP" ChannelEventTypePerson ChannelEventType = "PERSON" ChannelEventTypeBroadcast ChannelEventType = "BROADCAST" )
type ChannelInfo ¶
type ChannelListResp ¶
type ChannelListResp struct { WebResult Data *ChannelResp `json:"data"` }
==== Channel ====
type ChannelResp ¶
type ChannelResp struct { Channels []*ChannelInfo `json:"items"` Meta PageMeta `json:"meta"` }
type ChannelType ¶
type ChannelType int
const ( ChannelTypeText ChannelType = 0 ChannelTypeVoice ChannelType = 1 )
type Event ¶
type Event struct { ChannelType ChannelEventType `json:"channel_type"` EventType EventType `json:"type"` TargetId string `json:"target_id"` AuthorId string `json:"author_id"` Content string `json:"content"` MsgId string `json:"msg_id"` MsgTimestamp int `json:"msg_timestamp"` Nonce string `json:"nonce"` Extra interface{} `json:"extra"` }
func (*Event) GetSystemExtra ¶
func (e *Event) GetSystemExtra() *SystemExtra
func (*Event) GetUserExtra ¶
type ExitedChannel ¶ added in v1.3.0
type ExitedChannel struct { UserId string `json:"user_id" mapstructure:"user_id"` ChannelId string `json:"channel_id" mapstructure:"channel_id"` ExitedAt int `json:"exited_at" mapstructure:"exited_at"` }
用户退出语音频道
type GatewayResp ¶
type GatewayResp struct { WebResult GatewayInfo GatewayInfo `json:"data"` }
type Guild ¶
type Guild struct { Id string `json:"id"` Name string `json:"name"` Topic string `json:"topic"` UserId string `json:"user_id"` Icon string `json:"icon"` NotifyType NotifyType `json:"notify_type"` Region string `json:"region"` EnableOpen bool `json:"enable_open"` OpenId string `json:"open_id"` DefaultChannelId string `json:"default_channel_id"` WelcomeChannelId string `json:"welcome_channel_id"` Roles []Role `json:"roles"` Channels []Channel `json:"channels"` }
type GuildInfo ¶
type GuildInfo struct { GuildId string `json:"id"` Name string `json:"name"` Topic string `json:"topic"` UserId string `json:"user_id"` Icon string `json:"icon"` NotifyType NotifyType `json:"notify_type"` Region string `json:"region"` EnableOpen bool `json:"enable_open"` OpenId string `json:"open_id"` DefaultChannelId string `json:"default_channel_id"` WelcomeChannelId string `json:"welcome_channel_id"` BoostNum int `json:"boost_num"` Level int `json:"level"` }
type GuildListResp ¶
==== Guild ====
type HelloPack ¶
type HelloPack struct { Code SignalCode `json:"code"` SessionId string `json:"sessionId"` }
type JoinedChannel ¶ added in v1.3.0
type JoinedChannel struct { UserId string `json:"user_id" mapstructure:"user_id"` ChannelId string `json:"channel_id" mapstructure:"channel_id"` JoinedAt int `json:"joined_at" mapstructure:"joined_at"` }
system extra Body ==== 用户相关事件 ==== 用户加入语音频道
type KookResponse ¶ added in v1.3.0
type MessageBtnClick ¶ added in v1.3.0
type MessageBtnClick struct { GuildId string `json:"guild_id" mapstructure:"guild_id"` MsgId string `json:"msg_id" mapstructure:"msg_id"` TargetId string `json:"target_id" mapstructure:"target_id"` UserId string `json:"user_id" mapstructure:"user_id"` UserInfo User `json:"user_info" mapstructure:"user_info"` Value string `json:"value" mapstructure:"value"` }
Card 消息中的 Button 点击事件
type MessageCreateReq ¶
type MessageCreateResp ¶ added in v1.3.0
type MessageDeleteReq ¶
type MessageDeleteReq struct {
MsgId string `json:"msg_id"`
}
type MessageUpdateReq ¶
type NotifyType ¶
type NotifyType int
const ( NotifyTypeServer NotifyType = 0 NotifyTypeAll NotifyType = 1 NotifyTypeMentioned NotifyType = 2 NotifyTypeIgnore NotifyType = 3 )
type SelfExitedGuild ¶ added in v1.3.0
type SelfExitedGuild struct {
GuildId string `json:"guild_id" mapstructure:"guild_id"`
}
自己退出服务器
type SelfJoinedGuild ¶ added in v1.3.0
type SelfJoinedGuild struct { GuildId string `json:"guild_id" mapstructure:"guild_id"` State string `json:"state" mapstructure:"state"` }
自己新加入服务器
type Signal ¶
type Signal struct { SignalType SignalType `json:"s"` SerialNumber int `json:"sn"` Data map[string]any `json:"d"` }
ws 连接相关
func ParseSignal ¶
type SignalCode ¶
type SignalCode int
const ( Success SignalCode = 0 ConnMissParam SignalCode = 40100 InvalidToken SignalCode = 40101 ValidFailedToken SignalCode = 40102 ExpiredToken SignalCode = 40103 ResumeMissParam SignalCode = 40106 ExpiredSession SignalCode = 40107 InvalidSN SignalCode = 40108 )
type SignalType ¶
type SignalType int
const ( SIG_EVENT SignalType = 0 SIG_HELLO SignalType = 1 SIG_PING SignalType = 2 SIG_PONG SignalType = 3 SIG_RESUME SignalType = 4 SIG_RECONNECT SignalType = 5 SIG_RESUME_ACK SignalType = 6 )
type SystemExtra ¶
type User ¶
type User struct { Id string `json:"id"` Username string `json:"username"` Nickname string `json:"nickname"` IdentifyNum string `json:"identify_num"` Online bool `json:"online"` Bot bool `json:"bot"` Status int `json:"status"` Avatar string `json:"avatar"` VipAvatar string `json:"vip_avatar"` MobileVerified bool `json:"mobile_verified"` Roles []int `json:"roles"` }
type UserExtra ¶
type UserExtra struct { EventType EventType `json:"type" mapstructure:"event_type"` GuildId string `json:"guild_id" mapstructure:"guild_id"` ChannelName string `json:"channel_name" mapstructure:"channel_name"` Mention []string `json:"mention" mapstructure:"mention"` MentionAll bool `json:"mention_all" mapstructure:"mention_all"` MentionRoles []interface{} `json:"mention_roles" mapstructure:"mention_roles"` MentionHere bool `json:"mention_here" mapstructure:"mention_here"` Author User `json:"author" mapstructure:"author"` }
type UserUpdated ¶ added in v1.3.0
type UserUpdated struct { UserId string `json:"user_id"` UserName string `json:"username" mapstructure:"username"` Avatar int `json:"avatar" mapstructure:"avatar"` }
用户信息更新
Click to show internal directories.
Click to hide internal directories.