Documentation
¶
Index ¶
- Constants
- Variables
- type Attachment
- type AudioMessageContext
- type AudioMessageEventHandler
- type BlacklistCreate
- type BlacklistItem
- type BlockListAddContext
- type BlockListAddEventHandler
- type BlockListDeleteContext
- type BlockListDeleteEventHandler
- type BotExitContext
- type BotExitEventHandler
- type BotJoinContext
- type BotJoinEventHandler
- type CardMessage
- type CardMessageActionGroup
- type CardMessageCard
- type CardMessageContainer
- type CardMessageContext
- type CardMessageCountdown
- type CardMessageCountdownMode
- type CardMessageDivider
- type CardMessageElementButton
- type CardMessageElementButtonClick
- type CardMessageElementImage
- type CardMessageElementKMarkdown
- type CardMessageElementText
- type CardMessageFile
- type CardMessageFileType
- type CardMessageHeader
- type CardMessageImageGroup
- type CardMessageInvite
- type CardMessageParagraph
- type CardMessageSection
- type CardMessageSectionMode
- type CardSize
- type CardTheme
- type Channel
- type ChannelAddContext
- type ChannelAddEventHandler
- type ChannelCreate
- type ChannelDeleteContext
- type ChannelDeleteEventHandler
- type ChannelMessage
- type ChannelRoleBase
- type ChannelRoleCreate
- type ChannelRoleCreateResp
- type ChannelRoleDelete
- type ChannelRoleIndex
- type ChannelRoleUpdate
- type ChannelRoleUpdateResp
- type ChannelType
- type ChannelUpdate
- type ChannelUpdateContext
- type ChannelUpdateEventHandler
- type ChannelViewOption
- type DetailedChannelMessage
- type DirectMessageCreate
- type DirectMessageCreateOption
- type DirectMessageDeleteContext
- type DirectMessageDeleteEventHandler
- type DirectMessageListOption
- type DirectMessageReactionAddContext
- type DirectMessageReactionAddEventHandler
- type DirectMessageReactionDeleteContext
- type DirectMessageReactionDeleteEventHandler
- type DirectMessageResp
- type DirectMessageUpdate
- type DirectMessageUpdateContext
- type DirectMessageUpdateEventHandler
- type EmojiAddedContext
- type EmojiAddedEventHandler
- type EmojiItem
- type EndpointGeneralResponse
- type Entry
- type Event
- type EventCardMessageContext
- type EventCardMessageEventHandler
- type EventContext
- type EventCustomMessage
- type EventData
- type EventDataGeneral
- type EventDataHello
- type EventDataResumeAck
- type EventDataSystem
- type EventDirectChatReactionItem
- type EventEmojiItem
- type EventGuild
- type EventGuildMemberOnlineItem
- type EventHandler
- type EventHandlerCommonContext
- type EventHandlerProvider
- type EventKmarkdown
- type EventMentionPart
- type EventMentionRolePart
- type EventPinMessageItem
- type EventReactionItem
- type EventRichMessage
- type EventSignal
- type EventStatusCode
- type FileMessageContext
- type FileMessageEventHandler
- type Game
- type GameActivityMusicBody
- type GameCreate
- type GameListOption
- type GameType
- type GameUpdate
- type GeneralListData
- type Guild
- type GuildBoostHistoryItem
- type GuildBoostHistoryOption
- type GuildChannelMemberAddContext
- type GuildChannelMemberAddEventHandler
- type GuildChannelMemberDeleteContext
- type GuildChannelMemberDeleteEventHandler
- type GuildDeleteContext
- type GuildDeleteEventHandler
- type GuildEmojiResp
- type GuildMemberAddContext
- type GuildMemberAddEventHandler
- type GuildMemberDeleteContext
- type GuildMemberDeleteEventHandler
- type GuildMemberOfflineContext
- type GuildMemberOfflineEventHandler
- type GuildMemberOnlineContext
- type GuildMemberOnlineEventHandler
- type GuildMemberUpdateContext
- type GuildMemberUpdateEventHandler
- type GuildMuteList
- type GuildMuteSetting
- type GuildNickname
- type GuildNotifyType
- type GuildRoleAddContext
- type GuildRoleAddEventHandler
- type GuildRoleDeleteContext
- type GuildRoleDeleteEventHandler
- type GuildRoleResp
- type GuildRoleUpdateContext
- type GuildRoleUpdateEventHandler
- type GuildUpdateContext
- type GuildUpdateEventHandler
- type GuildUserListInfo
- type GuildUserListOption
- func GuildUserListWithActiveTime(activeTime bool) GuildUserListOption
- func GuildUserListWithChannelID(id string) GuildUserListOption
- func GuildUserListWithJoinedAt(joinedAt bool) GuildUserListOption
- func GuildUserListWithMobileVerified(verified bool) GuildUserListOption
- func GuildUserListWithRoleID(roleID int64) GuildUserListOption
- func GuildUserListWithSearch(search string) GuildUserListOption
- type Identify
- type ImageMessageContext
- type ImageMessageEventHandler
- type IntBool
- type IntimacyIndexResp
- type IntimacyUpdate
- type InviteCreate
- type InviteDelete
- type InviteDuration
- type InviteListOption
- type InviteListResp
- type InviteSettingTimes
- type KmarkdownMessageContext
- type KmarkdownMessageEventHandler
- type Logger
- type MessageButtonClickContext
- type MessageButtonClickEventHandler
- type MessageCreate
- type MessageCreateBase
- type MessageCreateOption
- type MessageDeleteContext
- type MessageDeleteEventHandler
- type MessageListFlag
- type MessageListOption
- type MessagePinContext
- type MessagePinEventHandler
- type MessageReaction
- type MessageResp
- type MessageType
- type MessageUnpinContext
- type MessageUnpinEventHandler
- type MessageUpdate
- type MessageUpdateBase
- type MessageUpdateContext
- type MessageUpdateEventHandler
- type MessageWithAttachment
- type MilliTimeStamp
- type MusicSoftware
- type MuteType
- type PageInfo
- type PageSetting
- type PermissionOverwrite
- type PrivateMessage
- type Quote
- type ReactedUser
- type ReactionAddContext
- type ReactionAddEventHandler
- type ReactionDeleteContext
- type ReactionDeleteEventHandler
- type ReactionItem
- type ReplyOption
- type RestError
- type Role
- type RolePermission
- type Session
- func (s *Session) AddHandler(h interface{}) func()
- func (s *Session) AssetCreate(name string, file []byte) (url string, err error)
- func (s *Session) BadgeGuildUrl(guildID string, style int) string
- func (s *Session) BlacklistCreate(bc *BlacklistCreate) (err error)
- func (s *Session) BlacklistDelete(guildID, targetID string) (err error)
- func (s *Session) BlacklistList(guildID string, page *PageSetting) (bi []*BlacklistItem, meta *PageInfo, err error)
- func (s *Session) ChannelCreate(cc *ChannelCreate) (c *Channel, err error)
- func (s *Session) ChannelDelete(channelID string) (err error)
- func (s *Session) ChannelList(guildID string, page *PageSetting) (cs []*Channel, meta *PageInfo, err error)
- func (s *Session) ChannelMoveUsers(targetChannelID string, userIDs []string) (err error)
- func (s *Session) ChannelRoleCreate(crc *ChannelRoleCreate) (crcr *ChannelRoleCreateResp, err error)
- func (s *Session) ChannelRoleDelete(crd *ChannelRoleDelete) (err error)
- func (s *Session) ChannelRoleIndex(channelID string) (cr *ChannelRoleIndex, err error)
- func (s *Session) ChannelRoleSync(cid string) (err error)
- func (s *Session) ChannelRoleUpdate(cru *ChannelRoleUpdate) (crur *ChannelRoleUpdateResp, err error)
- func (s *Session) ChannelUpdate(cu *ChannelUpdate) (c *Channel, err error)
- func (s *Session) ChannelUserGetJoinedChannel(guildID, userID string, page *PageSetting) (us []*UserInVoiceChannel, meta *PageInfo, err error)
- func (s *Session) ChannelUserList(channelID string) (us []*User, err error)
- func (s *Session) ChannelView(channelID string, options ...ChannelViewOption) (c *Channel, err error)
- func (s *Session) Close() (err error)
- func (s *Session) CloseWithCode(code int) (err error)
- func (s *Session) DirectMessageAddReaction(msgID, emoji string) (err error)
- func (s *Session) DirectMessageCreate(create *DirectMessageCreate) (mr *MessageResp, err error)
- func (s *Session) DirectMessageDelete(msgID string) (err error)
- func (s *Session) DirectMessageDeleteReaction(msgID, emoji string) (err error)
- func (s *Session) DirectMessageList(options ...DirectMessageListOption) (dmrs []*DirectMessageResp, err error)
- func (s *Session) DirectMessageReactionList(msgID, emoji string) (us []*ReactedUser, err error)
- func (s *Session) DirectMessageUpdate(update *DirectMessageUpdate) (err error)
- func (s *Session) DirectMessageView(chatCode, msgID string) (dmr *DirectMessageResp, err error)
- func (s *Session) GameActivity(id int64, payloads ...interface{}) (err error)
- func (s *Session) GameCreate(gc *GameCreate) (g *Game, err error)
- func (s *Session) GameDelete(id int64) (err error)
- func (s *Session) GameDeleteActivity() (err error)
- func (s *Session) GameList(page *PageSetting, options ...GameListOption) (gs []*Game, meta *PageInfo, err error)
- func (s *Session) GameUpdate(gu *GameUpdate) (g *Game, err error)
- func (s *Session) Gateway() (gateway string, err error)
- func (s *Session) GuildBoostHistory(guildID string, page *PageSetting, options ...GuildBoostHistoryOption) (hs []*GuildBoostHistoryItem, meta *PageInfo, err error)
- func (s *Session) GuildEmojiCreate(name, guildID string, emoji []byte) (ger *GuildEmojiResp, err error)
- func (s *Session) GuildEmojiDelete(id string) (err error)
- func (s *Session) GuildEmojiList(guildID string, page *PageSetting) (gers []*GuildEmojiResp, meta *PageInfo, err error)
- func (s *Session) GuildEmojiUpdate(name, id string) (err error)
- func (s *Session) GuildKickout(guildID, targetID string) (err error)
- func (s *Session) GuildLeave(guildID string) (err error)
- func (s *Session) GuildList(page *PageSetting) (gs []*Guild, meta *PageInfo, err error)
- func (s *Session) GuildMuteCreate(gms *GuildMuteSetting) (err error)
- func (s *Session) GuildMuteDelete(gms *GuildMuteSetting) (err error)
- func (s *Session) GuildMuteList(guildID string) (gml *GuildMuteList, err error)
- func (s *Session) GuildNickname(gn *GuildNickname) (err error)
- func (s *Session) GuildRoleCreate(name, guildID string) (r *Role, err error)
- func (s *Session) GuildRoleDelete(guildID, roleID string) (err error)
- func (s *Session) GuildRoleGrant(guildID, userID string, roleID int64) (grr *GuildRoleResp, err error)
- func (s *Session) GuildRoleList(guildID string, page *PageSetting) (rs []*Role, meta *PageInfo, err error)
- func (s *Session) GuildRoleRevoke(guildID, userID string, roleID int64) (grr *GuildRoleResp, err error)
- func (s *Session) GuildRoleUpdate(guildID string, role *Role) (r *Role, err error)
- func (s *Session) GuildUserList(guildID string, page *PageSetting, options ...GuildUserListOption) (us []*User, guli *GuildUserListInfo, meta *PageInfo, err error)
- func (s *Session) GuildView(guildID string) (g *Guild, err error)
- func (s *Session) IntimacyIndex(userID string) (iir *IntimacyIndexResp, err error)
- func (s *Session) IntimacyUpdate(iu *IntimacyUpdate) (err error)
- func (s *Session) InviteCreate(ic *InviteCreate) (URL string, err error)
- func (s *Session) InviteDelete(id *InviteDelete) (err error)
- func (s *Session) InviteList(page *PageSetting, options ...InviteListOption) (ilrs []*InviteListResp, meta *PageInfo, err error)
- func (s *Session) MessageAddReaction(msgID, emoji string) (err error)
- func (s *Session) MessageCreate(m *MessageCreate) (resp *MessageResp, err error)
- func (s *Session) MessageDelete(msgID string) (err error)
- func (s *Session) MessageDeleteReaction(msgID, emoji string, userID string) (err error)
- func (s *Session) MessageList(targetID string, options ...MessageListOption) (ms []*DetailedChannelMessage, err error)
- func (s *Session) MessageReactionList(msgID, emoji string) (us []*ReactedUser, err error)
- func (s *Session) MessageUpdate(m *MessageUpdate) (err error)
- func (s *Session) MessageView(msgId string) (m *DetailedChannelMessage, err error)
- func (s *Session) Open() (err error)
- func (s *Session) Request(method, url string, data interface{}) (response []byte, err error)
- func (s *Session) RequestWithPage(method, u string, page *PageSetting) (response []byte, meta *PageInfo, err error)
- func (s *Session) UserChatCreate(UserID string) (uc *UserChat, err error)
- func (s *Session) UserChatDelete(ChatCode string) (err error)
- func (s *Session) UserChatList(page *PageSetting) (ucs []*UserChat, meta *PageInfo, err error)
- func (s *Session) UserChatView(chatCode string) (uc *UserChat, err error)
- func (s *Session) UserMe() (u *User, err error)
- func (s *Session) UserOffline() error
- func (s *Session) UserView(userID string, options ...UserViewOption) (u *User, err error)
- func (s *Session) WebhookHandler() http.HandlerFunc
- type SessionOption
- type SnStore
- type TextMessageContext
- type TextMessageEventHandler
- type User
- type UserChat
- type UserInVoiceChannel
- type UserPermissionOverwrite
- type UserStatus
- type UserUpdateContext
- type UserUpdateEventHandler
- type UserViewOption
- type VideoMessageContext
- type VideoMessageEventHandler
Constants ¶
const ( GameTypeGame = iota GameTypeVup GameTypeProcess )
These are all GameType values.
Variables ¶
var ( APIVersion = "v3" EndpointBase = "https://www.kookapp.cn/api" EndpointAPI = urlJoin(EndpointBase, APIVersion) EndpointGuild = urlJoin(EndpointAPI, "guild") EndpointGuildMute = urlJoin(EndpointAPI, "guild-mute") EndpointGuildBoost = urlJoin(EndpointAPI, "guild-boost") EndpointChannel = urlJoin(EndpointAPI, "channel") EndpointChannelRole = urlJoin(EndpointAPI, "channel-role") EndpointChannelUser = urlJoin(EndpointAPI, "channel-user") EndpointMessage = urlJoin(EndpointAPI, "message") EndpointUserChat = urlJoin(EndpointAPI, "user-chat") EndpointDirectMessage = urlJoin(EndpointAPI, "direct-message") EndpointGateway = urlJoin(EndpointAPI, "gateway") EndpointUser = urlJoin(EndpointAPI, "user") EndpointAsset = urlJoin(EndpointAPI, "asset") EndpointGuildRole = urlJoin(EndpointAPI, "guild-role") EndpointIntimacy = urlJoin(EndpointAPI, "intimacy") EndpointGuildEmoji = urlJoin(EndpointAPI, "guild-emoji") EndpointInvite = urlJoin(EndpointAPI, "invite") EndpointBlacklist = urlJoin(EndpointAPI, "blacklist") EndpointBadge = urlJoin(EndpointAPI, "badge") EndpointGame = urlJoin(EndpointAPI, "game") EndpointGuildList = urlJoin(EndpointGuild, "list") EndpointGuildView = urlJoin(EndpointGuild, "view") EndpointGuildUserList = urlJoin(EndpointGuild, "user-list") EndpointGuildNickName = urlJoin(EndpointGuild, "nickname") EndpointGuildLeave = urlJoin(EndpointGuild, "leave") EndpointGuildKickout = urlJoin(EndpointGuild, "kickout") EndpointGuildMuteList = urlJoin(EndpointGuildMute, "list") EndpointGuildMuteCreate = urlJoin(EndpointGuildMute, "create") EndpointGuildMuteDelete = urlJoin(EndpointGuildMute, "delete") EndpointGuildBoostHistory = urlJoin(EndpointGuildBoost, "history") // EndpointChannelMessage is Deprecated. EndpointChannelMessage = urlJoin(EndpointChannel, "message") EndpointChannelList = urlJoin(EndpointChannel, "list") EndpointChannelView = urlJoin(EndpointChannel, "view") EndpointChannelCreate = urlJoin(EndpointChannel, "create") EndpointChannelMoveUser = urlJoin(EndpointChannel, "move-user") EndpointChannelUpdate = urlJoin(EndpointChannel, "update") EndpointChannelDelete = urlJoin(EndpointChannel, "delete") EndpointChannelRoleIndex = urlJoin(EndpointChannelRole, "index") EndpointChannelRoleCreate = urlJoin(EndpointChannelRole, "create") EndpointChannelRoleUpdate = urlJoin(EndpointChannelRole, "update") EndpointChannelRoleDelete = urlJoin(EndpointChannelRole, "delete") EndpointChannelRoleSync = urlJoin(EndpointChannelRole, "sync") EndpointChannelUserGetJoinedChannel = urlJoin(EndpointChannelUser, "get-joined-channel") EndpointChannelUserList = urlJoin(EndpointChannel, "user-list") EndpointMessageList = urlJoin(EndpointMessage, "list") EndpointMessageView = urlJoin(EndpointMessage, "view") EndpointMessageCreate = urlJoin(EndpointMessage, "create") EndpointMessageUpdate = urlJoin(EndpointMessage, "update") EndpointMessageDelete = urlJoin(EndpointMessage, "delete") EndpointMessageReactionList = urlJoin(EndpointMessage, "reaction-list") EndpointMessageAddReaction = urlJoin(EndpointMessage, "add-reaction") EndpointMessageDeleteReaction = urlJoin(EndpointMessage, "delete-reaction") EndpointUserChatList = urlJoin(EndpointUserChat, "list") EndpointUserChatView = urlJoin(EndpointUserChat, "view") EndpointUserChatCreate = urlJoin(EndpointUserChat, "create") EndpointUserChatDelete = urlJoin(EndpointUserChat, "delete") EndpointDirectMessageList = urlJoin(EndpointDirectMessage, "list") EndpointDirectMessageView = urlJoin(EndpointDirectMessage, "view") EndpointDirectMessageCreate = urlJoin(EndpointDirectMessage, "create") EndpointDirectMessageUpdate = urlJoin(EndpointDirectMessage, "update") EndpointDirectMessageDelete = urlJoin(EndpointDirectMessage, "delete") EndpointDirectMessageReactionList = urlJoin(EndpointDirectMessage, "reaction-list") EndpointDirectMessageAddReaction = urlJoin(EndpointDirectMessage, "add-reaction") EndpointDirectMessageDeleteReaction = urlJoin(EndpointDirectMessage, "delete-reaction") EndpointGatewayIndex = urlJoin(EndpointGateway, "index") EndpointUserMe = urlJoin(EndpointUser, "me") EndpointUserView = urlJoin(EndpointUser, "view") EndpointUserOffline = urlJoin(EndpointUser, "offline") EndpointAssetCreate = urlJoin(EndpointAsset, "create") EndpointGuildRoleList = urlJoin(EndpointGuildRole, "list") EndpointGuildRoleCreate = urlJoin(EndpointGuildRole, "create") EndpointGuildRoleUpdate = urlJoin(EndpointGuildRole, "update") EndpointGuildRoleDelete = urlJoin(EndpointGuildRole, "delete") EndpointGuildRoleGrant = urlJoin(EndpointGuildRole, "grant") EndpointGuildRoleRevoke = urlJoin(EndpointGuildRole, "revoke") EndpointIntimacyIndex = urlJoin(EndpointIntimacy, "index") EndpointIntimacyUpdate = urlJoin(EndpointIntimacy, "update") EndpointGuildEmojiList = urlJoin(EndpointGuildEmoji, "list") EndpointGuildEmojiCreate = urlJoin(EndpointGuildEmoji, "create") EndpointGuildEmojiUpdate = urlJoin(EndpointGuildEmoji, "update") EndpointGuildEmojiDelete = urlJoin(EndpointGuildEmoji, "delete") EndpointInviteList = urlJoin(EndpointInvite, "list") EndpointInviteCreate = urlJoin(EndpointInvite, "create") EndpointInviteDelete = urlJoin(EndpointInvite, "delete") EndpointBlacklistList = urlJoin(EndpointBlacklist, "list") EndpointBlacklistCreate = urlJoin(EndpointBlacklist, "create") EndpointBlacklistDelete = urlJoin(EndpointBlacklist, "delete") EndpointBadgeGuild = urlJoin(EndpointBadge, "guild") EndpointGameCreate = urlJoin(EndpointGame, "create") EndpointGameUpdate = urlJoin(EndpointGame, "update") EndpointGameDelete = urlJoin(EndpointGame, "delete") EndpointGameActivity = urlJoin(EndpointGame, "activity") EndpointGameDeleteActivity = urlJoin(EndpointGame, "delete-activity") )
All endpoints for http request
var ErrWSAlreadyOpen = errors.New("websocket is already opened")
ErrWSAlreadyOpen is the error when connecting with connected websocket.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Attachment struct {
Type string `json:"type"`
URL string `json:"url"`
Name string `json:"name"`
FileType string `json:"file_type"`
Size int64 `json:"size"`
Duration float64 `json:"duration"`
Width int `json:"width"`
Height int `json:"height"`
}
Attachment is the struct for various attachments, so that according to type, some fields may be empty.
type AudioMessageContext ¶
type AudioMessageContext struct {
*EventHandlerCommonContext
Extra EventRichMessage
}
func (*AudioMessageContext) GetCommon ¶
func (ctx *AudioMessageContext) GetCommon() *EventHandlerCommonContext
func (*AudioMessageContext) GetExtra ¶
func (ctx *AudioMessageContext) GetExtra() interface{}
type AudioMessageEventHandler ¶
type AudioMessageEventHandler func(*AudioMessageContext)
func (AudioMessageEventHandler) Handle ¶
func (eh AudioMessageEventHandler) Handle(i EventContext)
func (AudioMessageEventHandler) New ¶
func (eh AudioMessageEventHandler) New() EventContext
func (AudioMessageEventHandler) Type ¶
func (eh AudioMessageEventHandler) Type() string
type BlacklistCreate ¶
type BlacklistCreate struct {
GuildID string `json:"guild_id"`
TargetID string `json:"target_id"`
Remark string `json:"remark,omitempty"`
DelMsgDays int `json:"del_msg_days,omitempty"`
}
BlacklistCreate is the type for arguments of BlacklistCreate request.
type BlacklistItem ¶
type BlacklistItem struct {
UserID string `json:"user_id"`
CreatedTime MilliTimeStamp `json:"created_time"`
Remark string `json:"remark"`
User *User `json:"user"`
}
BlacklistItem is one user in blacklist.
type BlockListAddContext ¶
type BlockListAddContext struct {
*EventHandlerCommonContext
Extra struct {
Remark string `json:"remark"`
UserID []string `json:"user_id"`
OperatorID string `json:"operator_id"`
}
}
func (*BlockListAddContext) GetCommon ¶
func (ctx *BlockListAddContext) GetCommon() *EventHandlerCommonContext
func (*BlockListAddContext) GetExtra ¶
func (ctx *BlockListAddContext) GetExtra() interface{}
type BlockListAddEventHandler ¶
type BlockListAddEventHandler func(*BlockListAddContext)
func (BlockListAddEventHandler) Handle ¶
func (eh BlockListAddEventHandler) Handle(i EventContext)
func (BlockListAddEventHandler) New ¶
func (eh BlockListAddEventHandler) New() EventContext
func (BlockListAddEventHandler) Type ¶
func (eh BlockListAddEventHandler) Type() string
type BlockListDeleteContext ¶
type BlockListDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
UserID []string `json:"user_id"`
OperatorID string `json:"operator_id"`
}
}
func (*BlockListDeleteContext) GetCommon ¶
func (ctx *BlockListDeleteContext) GetCommon() *EventHandlerCommonContext
func (*BlockListDeleteContext) GetExtra ¶
func (ctx *BlockListDeleteContext) GetExtra() interface{}
type BlockListDeleteEventHandler ¶
type BlockListDeleteEventHandler func(*BlockListDeleteContext)
func (BlockListDeleteEventHandler) Handle ¶
func (eh BlockListDeleteEventHandler) Handle(i EventContext)
func (BlockListDeleteEventHandler) New ¶
func (eh BlockListDeleteEventHandler) New() EventContext
func (BlockListDeleteEventHandler) Type ¶
func (eh BlockListDeleteEventHandler) Type() string
type BotExitContext ¶
type BotExitContext struct {
*EventHandlerCommonContext
Extra struct {
GuildID string `json:"guild_id"`
}
}
func (*BotExitContext) GetCommon ¶
func (ctx *BotExitContext) GetCommon() *EventHandlerCommonContext
func (*BotExitContext) GetExtra ¶
func (ctx *BotExitContext) GetExtra() interface{}
type BotExitEventHandler ¶
type BotExitEventHandler func(*BotExitContext)
func (BotExitEventHandler) Handle ¶
func (eh BotExitEventHandler) Handle(i EventContext)
func (BotExitEventHandler) New ¶
func (eh BotExitEventHandler) New() EventContext
func (BotExitEventHandler) Type ¶
func (eh BotExitEventHandler) Type() string
type BotJoinContext ¶
type BotJoinContext struct {
*EventHandlerCommonContext
Extra struct {
GuildID string `json:"guild_id"`
}
}
func (*BotJoinContext) GetCommon ¶
func (ctx *BotJoinContext) GetCommon() *EventHandlerCommonContext
func (*BotJoinContext) GetExtra ¶
func (ctx *BotJoinContext) GetExtra() interface{}
type BotJoinEventHandler ¶
type BotJoinEventHandler func(*BotJoinContext)
func (BotJoinEventHandler) Handle ¶
func (eh BotJoinEventHandler) Handle(i EventContext)
func (BotJoinEventHandler) New ¶
func (eh BotJoinEventHandler) New() EventContext
func (BotJoinEventHandler) Type ¶
func (eh BotJoinEventHandler) Type() string
type CardMessage ¶
type CardMessage []*CardMessageCard
CardMessage is the type for a message of cards called 卡片消息.
func (CardMessage) BuildMessage ¶
func (c CardMessage) BuildMessage() (s string, err error)
BuildMessage is a helper function to marshal card message for sending.
func (CardMessage) MustBuildMessage ¶
func (c CardMessage) MustBuildMessage() string
MustBuildMessage is a helper function to marshal card message for sending.
type CardMessageActionGroup ¶
type CardMessageActionGroup []CardMessageElementButton
CardMessageActionGroup is the type for 模块-交互模块.
func (CardMessageActionGroup) MarshalJSON ¶
func (c CardMessageActionGroup) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageCard ¶
type CardMessageCard struct {
Theme CardTheme `json:"theme,omitempty"`
Color string `json:"color,omitempty"`
Size CardSize `json:"size,omitempty"`
Modules []interface{} `json:"modules"`
}
CardMessageCard is the type for 卡片.
func (*CardMessageCard) AddModule ¶
func (c *CardMessageCard) AddModule(i ...interface{}) *CardMessageCard
AddModule adds Modules to a card and provides a runtime type check for CardMessageCard Modules.
Allowed Modules: *CardMessageHeader, *CardMessageSection, *CardMessageImageGroup, *CardMessageContainer, *CardMessageActionGroup, *CardMessageContext, *CardMessageDivider, *CardMessageFile, *CardMessageCountdown.
func (CardMessageCard) MarshalJSON ¶
func (c CardMessageCard) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageContainer ¶
type CardMessageContainer []CardMessageElementImage
CardMessageContainer is the type for 可拓展图片模块.
func (*CardMessageContainer) AddElements ¶
func (c *CardMessageContainer) AddElements(i ...CardMessageElementImage) *CardMessageContainer
AddElements adds elements to container.
func (CardMessageContainer) MarshalJSON ¶
func (c CardMessageContainer) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling.
type CardMessageContext ¶
type CardMessageContext []interface{}
CardMessageContext is the type for 模块-备注模块.
func (*CardMessageContext) AddItem ¶
func (c *CardMessageContext) AddItem(i ...interface{}) *CardMessageContext
AddItem provides additional type-checking when adding elements to context.
Allowed elements: *CardMessageElementText, *CardMessageElementKMarkdown, *CardMessageElementImage
func (CardMessageContext) MarshalJSON ¶
func (c CardMessageContext) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageCountdown ¶
type CardMessageCountdown struct {
EndTime MilliTimeStamp `json:"endTime"`
StartTime MilliTimeStamp `json:"startTime"`
Mode CardMessageCountdownMode `json:"mode"`
}
CardMessageCountdown is the type for 模块-倒计时模块.
func (CardMessageCountdown) MarshalJSON ¶
func (c CardMessageCountdown) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageCountdownMode ¶
type CardMessageCountdownMode string
CardMessageCountdownMode is the type for modes of CardMessageCountdown
const ( CardMessageCountdownModeDay CardMessageCountdownMode = "day" CardMessageCountdownModeHour CardMessageCountdownMode = "hour" CardMessageCountdownModeSecond CardMessageCountdownMode = "second" )
These are predefined usable CardMessageCountdownModes
type CardMessageDivider ¶
type CardMessageDivider struct {
}
CardMessageDivider is the type for 模块-分割线模块.
func (CardMessageDivider) MarshalJSON ¶
func (c CardMessageDivider) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageElementButton ¶
type CardMessageElementButton struct {
Theme CardTheme `json:"theme"`
Value string `json:"value"`
Click string `json:"click,omitempty"`
Text string `json:"text"`
}
CardMessageElementButton is the type for 元素-按钮.
func (CardMessageElementButton) MarshalJSON ¶
func (c CardMessageElementButton) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageElementButtonClick ¶
type CardMessageElementButtonClick string
CardMessageElementButtonClick is the type for click modes of CardMessageElementButton
const ( CardMessageElementButtonClickLink CardMessageElementButtonClick = "link" CardMessageElementButtonClickReturnVal CardMessageElementButtonClick = "return-val" )
These are predefined usable CardMessageElementButtonClicks
type CardMessageElementImage ¶
type CardMessageElementImage struct {
Src string `json:"src"`
Alt string `json:"alt,omitempty"`
Size string `json:"size,omitempty"`
Circle bool `json:"circle"`
}
CardMessageElementImage is the type for 元素-图片.
func (CardMessageElementImage) MarshalJSON ¶
func (c CardMessageElementImage) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageElementKMarkdown ¶
type CardMessageElementKMarkdown struct {
Content string `json:"content"`
}
CardMessageElementKMarkdown is the type for 元素-kmarkdown.
func (CardMessageElementKMarkdown) MarshalJSON ¶
func (c CardMessageElementKMarkdown) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageElementText ¶
CardMessageElementText is the type for 元素-普通文本.
func (CardMessageElementText) MarshalJSON ¶
func (c CardMessageElementText) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageFile ¶
type CardMessageFile struct {
Type CardMessageFileType `json:"type"`
Src string `json:"src"`
Title string `json:"title,omitempty"`
Cover string `json:"cover,omitempty"`
}
CardMessageFile is the type for 模块-文件模块.
type CardMessageFileType ¶
type CardMessageFileType string
CardMessageFileType is the type for types of CardMessageFile
const ( CardMessageFileTypeFile CardMessageFileType = "file" CardMessageFileTypeAudio CardMessageFileType = "audio" CardMessageFileTypeVideo CardMessageFileType = "video" )
These are predefined usable CardMessageFileTypes
type CardMessageHeader ¶
type CardMessageHeader struct {
Text CardMessageElementText `json:"text"`
}
CardMessageHeader is the type for 模块-标题模块.
func (CardMessageHeader) MarshalJSON ¶
func (c CardMessageHeader) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageImageGroup ¶
type CardMessageImageGroup []CardMessageElementImage
CardMessageImageGroup is the type for 图片模块.
func (CardMessageImageGroup) MarshalJSON ¶
func (c CardMessageImageGroup) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageInvite ¶
type CardMessageInvite struct {
Code string `json:"code"`
}
CardMessageInvite is the type for 邀请模块.
func (CardMessageInvite) MarshalJSON ¶
func (c CardMessageInvite) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling.
type CardMessageParagraph ¶
type CardMessageParagraph struct {
Cols int `json:"cols"`
Fields []interface{} `json:"fields"`
}
CardMessageParagraph is the type for 结构体-区域文本.
func (*CardMessageParagraph) AddField ¶
func (c *CardMessageParagraph) AddField(i ...interface{}) *CardMessageParagraph
AddField provides additional type-checking when adding elements to paragraph.
Allowed elements: *CardMessageElementText, *CardMessageElementKMarkdown
func (CardMessageParagraph) MarshalJSON ¶
func (c CardMessageParagraph) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling
type CardMessageSection ¶
type CardMessageSection struct {
Mode CardMessageSectionMode `json:"mode,omitempty"`
Text interface{} `json:"text"`
Accessory interface{} `json:"accessory,omitempty"`
}
CardMessageSection is the type for 模块-内容模块.
func (CardMessageSection) MarshalJSON ¶
func (c CardMessageSection) MarshalJSON() ([]byte, error)
MarshalJSON adds additional type field when marshaling.
func (*CardMessageSection) SetAccessory ¶
func (c *CardMessageSection) SetAccessory(i interface{}) *CardMessageSection
SetAccessory provides additional type-checking when setting elements to section accessory.
Allowed elements: *CardMessageElementImage, *CardMessageElementButton.
func (*CardMessageSection) SetText ¶
func (c *CardMessageSection) SetText(i interface{}) *CardMessageSection
SetText provides additional type-checking when setting elements to section text.
Allowed elements: *CardMessageElementText, *CardMessageElementKMarkdown, *CardMessageParagraph.
type CardMessageSectionMode ¶
type CardMessageSectionMode string
CardMessageSectionMode is the type of mode for CardMessageSection
const ( CardMessageSectionModeLeft CardMessageSectionMode = "left" CardMessageSectionModeRight CardMessageSectionMode = "right" )
These are predefined usable CardMessageSectionModes
type Channel ¶
type Channel struct {
ID string `json:"id"`
Name string `json:"name"`
UserID string `json:"user_id"`
MasterID string `json:"master_id"`
GuildID string `json:"guild_id"`
Topic string `json:"topic"`
IsCategory IntBool `json:"is_category"`
ParentID string `json:"parent_id"`
Level int `json:"level"`
SlowMode int `json:"slow_mode"`
Type ChannelType `json:"type"`
LimitAmount int `json:"limit_amount"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites"`
PermissionUsers []UserPermissionOverwrite `json:"permission_users"`
PermissionSync IntBool `json:"permission_sync"`
ServerURL string `json:"server_url"`
HasPassword bool `json:"has_password"`
VoiceQuality string `json:"voice_quality"`
Children []string `json:"children"`
}
Channel is the struct for a channel in guild. For different channels, some fields may be empty.
type ChannelAddContext ¶
type ChannelAddContext struct {
*EventHandlerCommonContext
Extra Channel
}
func (*ChannelAddContext) GetCommon ¶
func (ctx *ChannelAddContext) GetCommon() *EventHandlerCommonContext
func (*ChannelAddContext) GetExtra ¶
func (ctx *ChannelAddContext) GetExtra() interface{}
type ChannelAddEventHandler ¶
type ChannelAddEventHandler func(*ChannelAddContext)
func (ChannelAddEventHandler) Handle ¶
func (eh ChannelAddEventHandler) Handle(i EventContext)
func (ChannelAddEventHandler) New ¶
func (eh ChannelAddEventHandler) New() EventContext
func (ChannelAddEventHandler) Type ¶
func (eh ChannelAddEventHandler) Type() string
type ChannelCreate ¶
type ChannelCreate struct {
GuildID string `json:"guild_id"`
ParentID string `json:"parent_id,omitempty"`
Name string `json:"name"`
Type ChannelType `json:"type,omitempty"`
LimitAmount int `json:"limit_amount,omitempty"`
VoiceQuality string `json:"voice_quality,omitempty"`
IsCategory int `json:"is_category"`
}
ChannelCreate is the arguments for creating a channel.
type ChannelDeleteContext ¶
type ChannelDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
ID string `json:"id"`
DeletedAt MilliTimeStamp `json:"deleted_at"`
}
}
func (*ChannelDeleteContext) GetCommon ¶
func (ctx *ChannelDeleteContext) GetCommon() *EventHandlerCommonContext
func (*ChannelDeleteContext) GetExtra ¶
func (ctx *ChannelDeleteContext) GetExtra() interface{}
type ChannelDeleteEventHandler ¶
type ChannelDeleteEventHandler func(*ChannelDeleteContext)
func (ChannelDeleteEventHandler) Handle ¶
func (eh ChannelDeleteEventHandler) Handle(i EventContext)
func (ChannelDeleteEventHandler) New ¶
func (eh ChannelDeleteEventHandler) New() EventContext
func (ChannelDeleteEventHandler) Type ¶
func (eh ChannelDeleteEventHandler) Type() string
type ChannelMessage ¶
type ChannelMessage struct {
MsgID string `json:"msg_id"`
Content string `json:"content"`
ContentID string `json:"content_id"`
Mention []string `json:"mention"`
MentionAll bool `json:"mention_all"`
MentionHere bool `json:"mention_here"`
MentionRole []string `json:"mention_role"`
UpdatedAt int64 `json:"updated_at"`
}
ChannelMessage is the struct for a message in a channel.
type ChannelRoleBase ¶
type ChannelRoleBase struct {
ChannelID string `json:"channel_id"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
}
ChannelRoleBase is the common arguments for channel role requests.
type ChannelRoleCreate ¶
type ChannelRoleCreate ChannelRoleBase
ChannelRoleCreate is the request query data for ChannelRoleCreate.
type ChannelRoleCreateResp ¶
type ChannelRoleCreateResp ChannelRoleUpdateResp
ChannelRoleCreateResp is the response for ChannelRoleCreate.
type ChannelRoleDelete ¶
type ChannelRoleDelete ChannelRoleBase
ChannelRoleDelete is the type for settings when deleting a role from channel setting.
type ChannelRoleIndex ¶
type ChannelRoleIndex struct {
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites"`
PermissionUsers []struct {
User User `json:"user"`
Allow RolePermission `json:"allow"`
Deny RolePermission `json:"deny"`
} `json:"permission_users"`
PermissionSync IntBool `json:"permission_sync"`
}
ChannelRoleIndex is the role and permission list of a channel.
type ChannelRoleUpdate ¶
type ChannelRoleUpdate struct {
ChannelRoleBase
Allow RolePermission `json:"allow,omitempty"`
Deny RolePermission `json:"deny,omitempty"`
}
ChannelRoleUpdate is the request query data for ChannelRoleUpdate
type ChannelRoleUpdateResp ¶
type ChannelRoleUpdateResp struct {
UserID string `json:"user_id"`
RoleID string `json:"role_id"`
Allow RolePermission `json:"allow"`
Deny RolePermission `json:"deny"`
}
ChannelRoleUpdateResp is the response of ChannelRoleUpdate
type ChannelType ¶
type ChannelType int8
ChannelType is the type of a channel.
const ( ChannelTypeText ChannelType = 1 + iota ChannelTypeVoice )
These are all channel types.
type ChannelUpdate ¶ added in v0.0.34
type ChannelUpdate struct {
ChannelID string `json:"channel_id"`
Name string `json:"name,omitempty"`
Level int `json:"level,omitempty"`
ParentID string `json:"parent_id,omitempty"`
Topic string `json:"topic,omitempty"`
SlowMode int `json:"slow_mode,omitempty"`
LimitAmount int `json:"limit_amount,omitempty"`
VoiceQuality string `json:"voice_quality,omitempty"`
Password string `json:"password,omitempty"`
}
ChannelUpdate is the arguments for updating a channel's settings.
type ChannelUpdateContext ¶
type ChannelUpdateContext struct {
*EventHandlerCommonContext
Extra Channel
}
func (*ChannelUpdateContext) GetCommon ¶
func (ctx *ChannelUpdateContext) GetCommon() *EventHandlerCommonContext
func (*ChannelUpdateContext) GetExtra ¶
func (ctx *ChannelUpdateContext) GetExtra() interface{}
type ChannelUpdateEventHandler ¶
type ChannelUpdateEventHandler func(*ChannelUpdateContext)
func (ChannelUpdateEventHandler) Handle ¶
func (eh ChannelUpdateEventHandler) Handle(i EventContext)
func (ChannelUpdateEventHandler) New ¶
func (eh ChannelUpdateEventHandler) New() EventContext
func (ChannelUpdateEventHandler) Type ¶
func (eh ChannelUpdateEventHandler) Type() string
type ChannelViewOption ¶ added in v0.0.34
ChannelViewOption is the type for optional arguments for ChannelView request.
func ChannelViewWithNeedChildren ¶ added in v0.0.34
func ChannelViewWithNeedChildren(needChildren bool) ChannelViewOption
ChannelViewWithNeedChildren adds optional `need_children` argument to ChannelView request.
type DetailedChannelMessage ¶
type DetailedChannelMessage struct {
ID string `json:"id"`
Type MessageType `json:"type"`
Author User `json:"author"`
Content string `json:"content"`
Mention []string `json:"mention"`
MentionAll bool `json:"mention_all"`
MentionHere bool `json:"mention_here"`
MentionRole []string `json:"mention_role"`
Embeds []map[string]string `json:"embeds"`
Attachments *Attachment `json:"attachments"`
Reactions []ReactionItem `json:"reactions"`
Quote *DetailedChannelMessage `json:"quote"`
MentionInfo struct {
MentionPart []*User `json:"mention_part"`
MentionRolePart []*Role `json:"mention_role_part"`
} `json:"mention_info"`
ChannelID string `json:"channel_id"`
}
DetailedChannelMessage is the struct for a detailed message in a channel.
type DirectMessageCreate ¶
type DirectMessageCreate struct {
MessageCreateBase
ChatCode string `json:"chat_code,omitempty"`
}
DirectMessageCreate is the struct for settings of creating a message in direct chat.
type DirectMessageCreateOption ¶
type DirectMessageCreateOption func(*DirectMessageCreate)
DirectMessageCreateOption is the type for decorator of DirectMessageCreate.
func DirectMessageCreateWithCard ¶
func DirectMessageCreateWithCard() DirectMessageCreateOption
DirectMessageCreateWithCard changes message type to card.
func DirectMessageCreateWithKmarkdown ¶
func DirectMessageCreateWithKmarkdown() DirectMessageCreateOption
DirectMessageCreateWithKmarkdown changes message type to Kmarkdown.
type DirectMessageDeleteContext ¶
type DirectMessageDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
AuthorID string `json:"author_id"`
TargetID string `json:"target_id"`
ChatCode string `json:"chat_code"`
DeletedAt MilliTimeStamp `json:"deleted_at"`
MsgID string `json:"msg_id"`
}
}
func (*DirectMessageDeleteContext) GetCommon ¶
func (ctx *DirectMessageDeleteContext) GetCommon() *EventHandlerCommonContext
func (*DirectMessageDeleteContext) GetExtra ¶
func (ctx *DirectMessageDeleteContext) GetExtra() interface{}
type DirectMessageDeleteEventHandler ¶
type DirectMessageDeleteEventHandler func(*DirectMessageDeleteContext)
func (DirectMessageDeleteEventHandler) Handle ¶
func (eh DirectMessageDeleteEventHandler) Handle(i EventContext)
func (DirectMessageDeleteEventHandler) New ¶
func (eh DirectMessageDeleteEventHandler) New() EventContext
func (DirectMessageDeleteEventHandler) Type ¶
func (eh DirectMessageDeleteEventHandler) Type() string
type DirectMessageListOption ¶
DirectMessageListOption is the type for optional arguments for DirectMessageList request.
func DirectMessageListWithChatCode ¶
func DirectMessageListWithChatCode(chatCode string) DirectMessageListOption
DirectMessageListWithChatCode adds optional `chat_code` argument to DirectMessageList request.
func DirectMessageListWithFlag ¶
func DirectMessageListWithFlag(flag MessageListFlag) DirectMessageListOption
DirectMessageListWithFlag adds optional `flag` argument to DirectMessageList request.
func DirectMessageListWithMsgID ¶
func DirectMessageListWithMsgID(msgID string) DirectMessageListOption
DirectMessageListWithMsgID adds optional `msg_id` argument to DirectMessageList request.
func DirectMessageListWithTargetID ¶
func DirectMessageListWithTargetID(targetID string) DirectMessageListOption
DirectMessageListWithTargetID adds optional `target_id` argument to DirectMessageList request.
type DirectMessageReactionAddContext ¶
type DirectMessageReactionAddContext struct {
*EventHandlerCommonContext
Extra EventDirectChatReactionItem
}
func (*DirectMessageReactionAddContext) GetCommon ¶
func (ctx *DirectMessageReactionAddContext) GetCommon() *EventHandlerCommonContext
func (*DirectMessageReactionAddContext) GetExtra ¶
func (ctx *DirectMessageReactionAddContext) GetExtra() interface{}
type DirectMessageReactionAddEventHandler ¶
type DirectMessageReactionAddEventHandler func(*DirectMessageReactionAddContext)
func (DirectMessageReactionAddEventHandler) Handle ¶
func (eh DirectMessageReactionAddEventHandler) Handle(i EventContext)
func (DirectMessageReactionAddEventHandler) New ¶
func (eh DirectMessageReactionAddEventHandler) New() EventContext
func (DirectMessageReactionAddEventHandler) Type ¶
func (eh DirectMessageReactionAddEventHandler) Type() string
type DirectMessageReactionDeleteContext ¶
type DirectMessageReactionDeleteContext struct {
*EventHandlerCommonContext
Extra EventDirectChatReactionItem
}
func (*DirectMessageReactionDeleteContext) GetCommon ¶
func (ctx *DirectMessageReactionDeleteContext) GetCommon() *EventHandlerCommonContext
func (*DirectMessageReactionDeleteContext) GetExtra ¶
func (ctx *DirectMessageReactionDeleteContext) GetExtra() interface{}
type DirectMessageReactionDeleteEventHandler ¶
type DirectMessageReactionDeleteEventHandler func(*DirectMessageReactionDeleteContext)
func (DirectMessageReactionDeleteEventHandler) Handle ¶
func (eh DirectMessageReactionDeleteEventHandler) Handle(i EventContext)
func (DirectMessageReactionDeleteEventHandler) New ¶
func (eh DirectMessageReactionDeleteEventHandler) New() EventContext
func (DirectMessageReactionDeleteEventHandler) Type ¶
func (eh DirectMessageReactionDeleteEventHandler) Type() string
type DirectMessageResp ¶
type DirectMessageResp struct {
ID string `json:"id"`
Type MessageType `json:"type"`
Content string `json:"content"`
Embeds []map[string]string `json:"embeds"`
Attachments []Attachment `json:"attachments"`
CreateAt MilliTimeStamp `json:"create_at"`
UpdatedAt MilliTimeStamp `json:"updated_at"`
Reactions []ReactionItem `json:"reactions"`
ImageName string `json:"image_name"`
ReadStatus bool `json:"read_status"`
Quote *User `json:"quote"`
MentionInfo struct {
MentionPart []*User `json:"mention_part"`
MentionRolePart []*Role `json:"mention_role_part"`
} `json:"mention_info"`
}
DirectMessageResp is the type for direct messages.
type DirectMessageUpdate ¶
type DirectMessageUpdate MessageUpdateBase
DirectMessageUpdate is the type for settings of updating a message in direct chat.
type DirectMessageUpdateContext ¶
type DirectMessageUpdateContext struct {
*EventHandlerCommonContext
Extra struct {
Content string `json:"content"`
ChatCode string `json:"chat_code"`
UpdatedAt MilliTimeStamp `json:"updated_at"`
MsgID string `json:"msg_id"`
AuthorID string `json:"author_id"`
TargetID string `json:"target_id"`
}
}
func (*DirectMessageUpdateContext) GetCommon ¶
func (ctx *DirectMessageUpdateContext) GetCommon() *EventHandlerCommonContext
func (*DirectMessageUpdateContext) GetExtra ¶
func (ctx *DirectMessageUpdateContext) GetExtra() interface{}
type DirectMessageUpdateEventHandler ¶
type DirectMessageUpdateEventHandler func(*DirectMessageUpdateContext)
func (DirectMessageUpdateEventHandler) Handle ¶
func (eh DirectMessageUpdateEventHandler) Handle(i EventContext)
func (DirectMessageUpdateEventHandler) New ¶
func (eh DirectMessageUpdateEventHandler) New() EventContext
func (DirectMessageUpdateEventHandler) Type ¶
func (eh DirectMessageUpdateEventHandler) Type() string
type EmojiAddedContext ¶ added in v0.0.34
type EmojiAddedContext struct {
*EventHandlerCommonContext
Extra EventEmojiItem
}
func (*EmojiAddedContext) GetCommon ¶ added in v0.0.34
func (ctx *EmojiAddedContext) GetCommon() *EventHandlerCommonContext
type EmojiAddedEventHandler ¶ added in v0.0.34
type EmojiAddedEventHandler func(*EmojiAddedContext)
func (EmojiAddedEventHandler) Handle ¶ added in v0.0.34
func (eh EmojiAddedEventHandler) Handle(i EventContext)
func (EmojiAddedEventHandler) New ¶ added in v0.0.34
func (eh EmojiAddedEventHandler) New() EventContext
type EmojiItem ¶
EmojiItem is the type for an emoji.
type EndpointGeneralResponse ¶
type EndpointGeneralResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
}
EndpointGeneralResponse is the struct for initial parsing REST requests.
type Entry ¶
type Entry interface {
Bool(key string, b bool) Entry
Bytes(key string, val []byte) Entry
Caller(depth int) Entry
Dur(key string, d time.Duration) Entry
Err(key string, err error) Entry
Float64(key string, f float64) Entry
IPAddr(key string, ip net.IP) Entry
Int(key string, i int) Entry
Int64(key string, i int64) Entry
Interface(key string, i interface{}) Entry
Msg(msg string)
Msgf(f string, i ...interface{})
Str(key string, s string) Entry
Strs(key string, s []string) Entry
Time(key string, t time.Time) Entry
}
Entry is the interface which external loggers' entry should meet.
type Event ¶
type Event struct {
Signal EventSignal `json:"s"`
Data json.RawMessage `json:"d"`
SequenceNumber int64 `json:"sn"`
}
Event is the struct for every received event.
type EventCardMessageContext ¶
type EventCardMessageContext struct {
*EventHandlerCommonContext
Extra EventCustomMessage
}
func (*EventCardMessageContext) GetCommon ¶
func (ctx *EventCardMessageContext) GetCommon() *EventHandlerCommonContext
func (*EventCardMessageContext) GetExtra ¶
func (ctx *EventCardMessageContext) GetExtra() interface{}
type EventCardMessageEventHandler ¶
type EventCardMessageEventHandler func(*EventCardMessageContext)
func (EventCardMessageEventHandler) Handle ¶
func (eh EventCardMessageEventHandler) Handle(i EventContext)
func (EventCardMessageEventHandler) New ¶
func (eh EventCardMessageEventHandler) New() EventContext
func (EventCardMessageEventHandler) Type ¶
func (eh EventCardMessageEventHandler) Type() string
type EventContext ¶
type EventContext interface {
GetExtra() interface{}
GetCommon() *EventHandlerCommonContext
}
EventContext is the interface for objects containing context for event handlers.
type EventCustomMessage ¶
type EventCustomMessage struct {
Mention []string `json:"mention"`
MentionAll bool `json:"mention_all"`
MentionRoles []int64 `json:"mention_roles"`
MentionHere bool `json:"mention_here"`
Author User `json:"author"`
Kmarkdown EventKmarkdown `json:"kmarkdown"`
Quote *Quote `json:"quote"`
GuildID string `json:"guild_id"`
ChannelName string `json:"channel_name"`
}
func (*EventCustomMessage) UnmarshalJSON ¶
func (m *EventCustomMessage) UnmarshalJSON(bytes []byte) error
UnmarshalJSON deals with untyped mention in custom message in event.
type EventData ¶
type EventData struct {
*EventDataGeneral
Extra json.RawMessage `json:"extra"`
}
EventData is the struct for initial parsing event's data payload.
type EventDataGeneral ¶
type EventDataGeneral struct {
ChannelType string `json:"channel_type"`
Type MessageType `json:"type"`
TargetID string `json:"target_id"`
AuthorID string `json:"author_id"`
Content string `json:"content"`
MsgID string `json:"msg_id"`
MsgTimestamp int64 `json:"msg_timestamp"`
Nonce string `json:"nonce"`
}
EventDataGeneral is the struct passed to all event handler.
type EventDataHello ¶
type EventDataHello struct {
Code EventStatusCode `json:"code"`
SessionID string `json:"session_id"`
}
EventDataHello is the struct for the data of event hello
type EventDataResumeAck ¶
type EventDataResumeAck struct {
SessionID string `json:"session_id"`
}
EventDataResumeAck is the struct for the data of event resume ack.
type EventDataSystem ¶
type EventDataSystem struct {
Type string `json:"type"`
Body json.RawMessage `json:"body"`
}
EventDataSystem is the struct for initial parsing system events. TODO: Implement a marshaller.
type EventDirectChatReactionItem ¶
type EventDirectChatReactionItem struct {
ChatCode string `json:"chat_code"`
Emoji EventEmojiItem `json:"emoji"`
MsgID string `json:"msg_id"`
UserID string `json:"user_id"`
}
type EventEmojiItem ¶ added in v0.0.34
type EventGuild ¶
type EventGuild struct {
WelcomeChannelID string `json:"welcome_channel_id"`
ID string `json:"id"`
Name string `json:"name"`
UserID string `json:"user_id"`
Icon string `json:"icon"`
Region string `json:"region"`
OpenID int64 `json:"open_id"`
DefaultChannelID string `json:"default_channel_id"`
NotifyType GuildNotifyType `json:"notify_type"`
EnableOpen IntBool `json:"enable_open"`
}
type EventGuildMemberOnlineItem ¶
type EventGuildMemberOnlineItem struct {
EventTime MilliTimeStamp `json:"event_time"`
Guilds []string `json:"guilds"`
UserId string `json:"user_id"`
}
type EventHandler ¶
type EventHandler interface {
Type() string
Handle(EventContext)
}
EventHandler is the interface for objects handling event.
type EventHandlerCommonContext ¶
type EventHandlerCommonContext struct {
Session *Session
Common *EventDataGeneral
}
EventHandlerCommonContext is the common context for event handlers.
type EventHandlerProvider ¶
type EventHandlerProvider interface {
Type() string
New() EventContext
}
EventHandlerProvider is the interface for objects providing event handlers.
type EventKmarkdown ¶
type EventKmarkdown struct {
RawContent string `json:"raw_content"`
MentionPart []EventMentionPart `json:"mention_part"`
MentionRolePart []EventMentionRolePart `json:"mention_role_part"`
}
type EventMentionPart ¶
type EventMentionRolePart ¶
type EventPinMessageItem ¶
type EventReactionItem ¶
type EventReactionItem struct {
MsgID string `json:"msg_id"`
UserID string `json:"user_id"`
ChannelID string `json:"channel_id"`
Emoji EventEmojiItem `json:"emoji"`
}
type EventRichMessage ¶
type EventRichMessage struct {
GuildID string `json:"guild_id"`
Attachments Attachment `json:"attachments"`
Author User `json:"author"`
}
type EventSignal ¶
type EventSignal int8
EventSignal is the type for event types.
const ( EventSignalEvent EventSignal = iota EventSignalHello EventSignalPing EventSignalPong EventSignalReconnect EventSignal = iota + 1 EventSignalResumeAck )
All event signal consts.
type EventStatusCode ¶
type EventStatusCode int
EventStatusCode is the type for various event status code.
const ( EventStatusOk EventStatusCode = 0 EventStatusMissingArgument EventStatusCode = 40100 + iota EventStatusInvalidToken EventStatusTokenAuthFailed EventStatusTokenExpired EventStatusResumeFailed EventStatusCode = 40100 + 2 + iota EventStatusSessionExpired EventStatusInvalidSequenceNumber )
EventStatusCode consts for event status
type FileMessageContext ¶
type FileMessageContext struct {
*EventHandlerCommonContext
Extra EventRichMessage
}
func (*FileMessageContext) GetCommon ¶
func (ctx *FileMessageContext) GetCommon() *EventHandlerCommonContext
func (*FileMessageContext) GetExtra ¶
func (ctx *FileMessageContext) GetExtra() interface{}
type FileMessageEventHandler ¶
type FileMessageEventHandler func(*FileMessageContext)
func (FileMessageEventHandler) Handle ¶
func (eh FileMessageEventHandler) Handle(i EventContext)
func (FileMessageEventHandler) New ¶
func (eh FileMessageEventHandler) New() EventContext
func (FileMessageEventHandler) Type ¶
func (eh FileMessageEventHandler) Type() string
type Game ¶
type Game struct {
ID int64 `json:"id"`
Name string `json:"name"`
Type GameType `json:"type"`
Options string `json:"options"`
KmhookAdmin bool `json:"kmhook_admin"`
ProcessName []string `json:"process_name"`
ProductName []string `json:"product_name"`
Icon string `json:"icon"`
}
Game is a game item registered at kook.
type GameActivityMusicBody ¶
type GameActivityMusicBody struct {
Software MusicSoftware `json:"software,omitempty"`
Singer string `json:"singer,omitempty"`
MusicName string `json:"music_name,omitempty"`
}
GameActivityMusicBody is the necessary data for music activity.
type GameCreate ¶
type GameCreate struct {
Name string `json:"name"`
ProcessName string `json:"process_name,omitempty"`
Icon string `json:"icon,omitempty"`
}
GameCreate is the type for arguments of GameCreate request.
type GameListOption ¶ added in v0.0.34
GameListOption is the type for optional arguments for GameList request.
func GameListWithType ¶ added in v0.0.34
func GameListWithType(t GameType) GameListOption
GameListWithType filters the type of game in GameList request.
type GameUpdate ¶
type GameUpdate struct {
ID int64 `json:"id"`
Name string `json:"name,omitempty"`
Icon string `json:"icon,omitempty"`
}
GameUpdate is the type for arguments of GameUpdate request.
type GeneralListData ¶
type GeneralListData struct {
Items json.RawMessage `json:"items"`
Meta PageInfo `json:"meta"`
Sort map[string]int `json:"sort"`
}
GeneralListData is the struct for list GET responses.
type Guild ¶
type Guild struct {
ID string `json:"id"`
Name string `json:"name"`
Topic string `json:"topic"`
MasterID string `json:"master_id"`
// For compatibility reason
UserID string `json:"user_id"`
Icon string `json:"icon"`
NotifyType GuildNotifyType `json:"notify_type"`
Region string `json:"region"`
EnableOpen IntBool `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"`
}
Guild is the struct for a server/guild(服务器).
func (Guild) GetMasterID ¶
GetMasterID returns the master id of the guild, not sure if it is necessary as may doc is wrong.
type GuildBoostHistoryItem ¶ added in v0.0.34
type GuildBoostHistoryItem struct {
UserID string `json:"user_id"`
GuildID string `json:"guild_id"`
StartTime int64 `json:"start_time"`
EndTime int64 `json:"end_time"`
User *User `json:"user"`
}
GuildBoostHistoryItem is the historical supporter' info.
type GuildBoostHistoryOption ¶ added in v0.0.34
GuildBoostHistoryOption is the optional arguments for GuildBoostHistory requests.
func GuildBoostHistoryWithEndTime ¶ added in v0.0.34
func GuildBoostHistoryWithEndTime(t int64) GuildBoostHistoryOption
GuildBoostHistoryWithEndTime adds optional `end_time` argument to GuildBoostHistory request.
func GuildBoostHistoryWithStartTime ¶ added in v0.0.34
func GuildBoostHistoryWithStartTime(t int64) GuildBoostHistoryOption
GuildBoostHistoryWithStartTime adds optional `start_time` argument to GuildBoostHistory request.
type GuildChannelMemberAddContext ¶
type GuildChannelMemberAddContext struct {
*EventHandlerCommonContext
Extra struct {
JoinedAt MilliTimeStamp `json:"joined_at"`
UserID string `json:"user_id"`
ChannelID string `json:"channel_id"`
}
}
func (*GuildChannelMemberAddContext) GetCommon ¶
func (ctx *GuildChannelMemberAddContext) GetCommon() *EventHandlerCommonContext
func (*GuildChannelMemberAddContext) GetExtra ¶
func (ctx *GuildChannelMemberAddContext) GetExtra() interface{}
type GuildChannelMemberAddEventHandler ¶
type GuildChannelMemberAddEventHandler func(*GuildChannelMemberAddContext)
func (GuildChannelMemberAddEventHandler) Handle ¶
func (eh GuildChannelMemberAddEventHandler) Handle(i EventContext)
func (GuildChannelMemberAddEventHandler) New ¶
func (eh GuildChannelMemberAddEventHandler) New() EventContext
func (GuildChannelMemberAddEventHandler) Type ¶
func (eh GuildChannelMemberAddEventHandler) Type() string
type GuildChannelMemberDeleteContext ¶
type GuildChannelMemberDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
UserID string `json:"user_id"`
ChannelID string `json:"channel_id"`
ExitedAt MilliTimeStamp `json:"exited_at"`
}
}
func (*GuildChannelMemberDeleteContext) GetCommon ¶
func (ctx *GuildChannelMemberDeleteContext) GetCommon() *EventHandlerCommonContext
func (*GuildChannelMemberDeleteContext) GetExtra ¶
func (ctx *GuildChannelMemberDeleteContext) GetExtra() interface{}
type GuildChannelMemberDeleteEventHandler ¶
type GuildChannelMemberDeleteEventHandler func(*GuildChannelMemberDeleteContext)
func (GuildChannelMemberDeleteEventHandler) Handle ¶
func (eh GuildChannelMemberDeleteEventHandler) Handle(i EventContext)
func (GuildChannelMemberDeleteEventHandler) New ¶
func (eh GuildChannelMemberDeleteEventHandler) New() EventContext
func (GuildChannelMemberDeleteEventHandler) Type ¶
func (eh GuildChannelMemberDeleteEventHandler) Type() string
type GuildDeleteContext ¶
type GuildDeleteContext struct {
*EventHandlerCommonContext
Extra EventGuild
}
func (*GuildDeleteContext) GetCommon ¶
func (ctx *GuildDeleteContext) GetCommon() *EventHandlerCommonContext
func (*GuildDeleteContext) GetExtra ¶
func (ctx *GuildDeleteContext) GetExtra() interface{}
type GuildDeleteEventHandler ¶
type GuildDeleteEventHandler func(*GuildDeleteContext)
func (GuildDeleteEventHandler) Handle ¶
func (eh GuildDeleteEventHandler) Handle(i EventContext)
func (GuildDeleteEventHandler) New ¶
func (eh GuildDeleteEventHandler) New() EventContext
func (GuildDeleteEventHandler) Type ¶
func (eh GuildDeleteEventHandler) Type() string
type GuildEmojiResp ¶
type GuildEmojiResp struct {
Name string `json:"name"`
ID string `json:"id"`
UserInfo User `json:"user_info"`
}
GuildEmojiResp is the type for response of GuildEmojiList request.
type GuildMemberAddContext ¶
type GuildMemberAddContext struct {
*EventHandlerCommonContext
Extra struct {
UserID string `json:"user_id"`
JoinedAt MilliTimeStamp `json:"joined_at"`
}
}
func (*GuildMemberAddContext) GetCommon ¶
func (ctx *GuildMemberAddContext) GetCommon() *EventHandlerCommonContext
func (*GuildMemberAddContext) GetExtra ¶
func (ctx *GuildMemberAddContext) GetExtra() interface{}
type GuildMemberAddEventHandler ¶
type GuildMemberAddEventHandler func(*GuildMemberAddContext)
func (GuildMemberAddEventHandler) Handle ¶
func (eh GuildMemberAddEventHandler) Handle(i EventContext)
func (GuildMemberAddEventHandler) New ¶
func (eh GuildMemberAddEventHandler) New() EventContext
func (GuildMemberAddEventHandler) Type ¶
func (eh GuildMemberAddEventHandler) Type() string
type GuildMemberDeleteContext ¶
type GuildMemberDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
UserID string `json:"user_id"`
ExitedAt MilliTimeStamp `json:"exited_at"`
}
}
func (*GuildMemberDeleteContext) GetCommon ¶
func (ctx *GuildMemberDeleteContext) GetCommon() *EventHandlerCommonContext
func (*GuildMemberDeleteContext) GetExtra ¶
func (ctx *GuildMemberDeleteContext) GetExtra() interface{}
type GuildMemberDeleteEventHandler ¶
type GuildMemberDeleteEventHandler func(*GuildMemberDeleteContext)
func (GuildMemberDeleteEventHandler) Handle ¶
func (eh GuildMemberDeleteEventHandler) Handle(i EventContext)
func (GuildMemberDeleteEventHandler) New ¶
func (eh GuildMemberDeleteEventHandler) New() EventContext
func (GuildMemberDeleteEventHandler) Type ¶
func (eh GuildMemberDeleteEventHandler) Type() string
type GuildMemberOfflineContext ¶
type GuildMemberOfflineContext struct {
*EventHandlerCommonContext
Extra EventGuildMemberOnlineItem
}
func (*GuildMemberOfflineContext) GetCommon ¶
func (ctx *GuildMemberOfflineContext) GetCommon() *EventHandlerCommonContext
func (*GuildMemberOfflineContext) GetExtra ¶
func (ctx *GuildMemberOfflineContext) GetExtra() interface{}
type GuildMemberOfflineEventHandler ¶
type GuildMemberOfflineEventHandler func(*GuildMemberOfflineContext)
func (GuildMemberOfflineEventHandler) Handle ¶
func (eh GuildMemberOfflineEventHandler) Handle(i EventContext)
func (GuildMemberOfflineEventHandler) New ¶
func (eh GuildMemberOfflineEventHandler) New() EventContext
func (GuildMemberOfflineEventHandler) Type ¶
func (eh GuildMemberOfflineEventHandler) Type() string
type GuildMemberOnlineContext ¶
type GuildMemberOnlineContext struct {
*EventHandlerCommonContext
Extra EventGuildMemberOnlineItem
}
func (*GuildMemberOnlineContext) GetCommon ¶
func (ctx *GuildMemberOnlineContext) GetCommon() *EventHandlerCommonContext
func (*GuildMemberOnlineContext) GetExtra ¶
func (ctx *GuildMemberOnlineContext) GetExtra() interface{}
type GuildMemberOnlineEventHandler ¶
type GuildMemberOnlineEventHandler func(*GuildMemberOnlineContext)
func (GuildMemberOnlineEventHandler) Handle ¶
func (eh GuildMemberOnlineEventHandler) Handle(i EventContext)
func (GuildMemberOnlineEventHandler) New ¶
func (eh GuildMemberOnlineEventHandler) New() EventContext
func (GuildMemberOnlineEventHandler) Type ¶
func (eh GuildMemberOnlineEventHandler) Type() string
type GuildMemberUpdateContext ¶
type GuildMemberUpdateContext struct {
*EventHandlerCommonContext
Extra struct {
Nickname string `json:"nickname"`
UserID string `json:"user_id"`
}
}
func (*GuildMemberUpdateContext) GetCommon ¶
func (ctx *GuildMemberUpdateContext) GetCommon() *EventHandlerCommonContext
func (*GuildMemberUpdateContext) GetExtra ¶
func (ctx *GuildMemberUpdateContext) GetExtra() interface{}
type GuildMemberUpdateEventHandler ¶
type GuildMemberUpdateEventHandler func(*GuildMemberUpdateContext)
func (GuildMemberUpdateEventHandler) Handle ¶
func (eh GuildMemberUpdateEventHandler) Handle(i EventContext)
func (GuildMemberUpdateEventHandler) New ¶
func (eh GuildMemberUpdateEventHandler) New() EventContext
func (GuildMemberUpdateEventHandler) Type ¶
func (eh GuildMemberUpdateEventHandler) Type() string
type GuildMuteList ¶
GuildMuteList is the type for users that got muted in a guild.
type GuildMuteSetting ¶
type GuildMuteSetting struct {
GuildID string `json:"guild_id"`
UserID string `json:"user_id"`
Type MuteType `json:"type"`
}
GuildMuteSetting is the type for arguments of GuildMuteSetting.
type GuildNickname ¶
type GuildNickname struct {
GuildID string `json:"guild_id"`
Nickname string `json:"nickname,omitempty"`
UserID string `json:"user_id,omitempty"`
}
GuildNickname is the arguments for GuildNickname.
type GuildNotifyType ¶
type GuildNotifyType int8
GuildNotifyType is the type of the notify type of a guild.
const ( GuildNotifyTypeDefault GuildNotifyType = iota GuildNotifyTypeAll GuildNotifyTypeMention GuildNotifyTypeDisable )
These are all notify types.
type GuildRoleAddContext ¶
type GuildRoleAddContext struct {
*EventHandlerCommonContext
Extra Role
}
func (*GuildRoleAddContext) GetCommon ¶
func (ctx *GuildRoleAddContext) GetCommon() *EventHandlerCommonContext
func (*GuildRoleAddContext) GetExtra ¶
func (ctx *GuildRoleAddContext) GetExtra() interface{}
type GuildRoleAddEventHandler ¶
type GuildRoleAddEventHandler func(*GuildRoleAddContext)
func (GuildRoleAddEventHandler) Handle ¶
func (eh GuildRoleAddEventHandler) Handle(i EventContext)
func (GuildRoleAddEventHandler) New ¶
func (eh GuildRoleAddEventHandler) New() EventContext
func (GuildRoleAddEventHandler) Type ¶
func (eh GuildRoleAddEventHandler) Type() string
type GuildRoleDeleteContext ¶
type GuildRoleDeleteContext struct {
*EventHandlerCommonContext
Extra Role
}
func (*GuildRoleDeleteContext) GetCommon ¶
func (ctx *GuildRoleDeleteContext) GetCommon() *EventHandlerCommonContext
func (*GuildRoleDeleteContext) GetExtra ¶
func (ctx *GuildRoleDeleteContext) GetExtra() interface{}
type GuildRoleDeleteEventHandler ¶
type GuildRoleDeleteEventHandler func(*GuildRoleDeleteContext)
func (GuildRoleDeleteEventHandler) Handle ¶
func (eh GuildRoleDeleteEventHandler) Handle(i EventContext)
func (GuildRoleDeleteEventHandler) New ¶
func (eh GuildRoleDeleteEventHandler) New() EventContext
func (GuildRoleDeleteEventHandler) Type ¶
func (eh GuildRoleDeleteEventHandler) Type() string
type GuildRoleResp ¶
type GuildRoleResp struct {
GuildID string `json:"guild_id"`
UserID string `json:"user_id"`
Roles []int64 `json:"roles"`
}
GuildRoleResp is the response of GuildRoleGrant request.
type GuildRoleUpdateContext ¶
type GuildRoleUpdateContext struct {
*EventHandlerCommonContext
Extra Role
}
func (*GuildRoleUpdateContext) GetCommon ¶
func (ctx *GuildRoleUpdateContext) GetCommon() *EventHandlerCommonContext
func (*GuildRoleUpdateContext) GetExtra ¶
func (ctx *GuildRoleUpdateContext) GetExtra() interface{}
type GuildRoleUpdateEventHandler ¶
type GuildRoleUpdateEventHandler func(*GuildRoleUpdateContext)
func (GuildRoleUpdateEventHandler) Handle ¶
func (eh GuildRoleUpdateEventHandler) Handle(i EventContext)
func (GuildRoleUpdateEventHandler) New ¶
func (eh GuildRoleUpdateEventHandler) New() EventContext
func (GuildRoleUpdateEventHandler) Type ¶
func (eh GuildRoleUpdateEventHandler) Type() string
type GuildUpdateContext ¶
type GuildUpdateContext struct {
*EventHandlerCommonContext
Extra EventGuild
}
func (*GuildUpdateContext) GetCommon ¶
func (ctx *GuildUpdateContext) GetCommon() *EventHandlerCommonContext
func (*GuildUpdateContext) GetExtra ¶
func (ctx *GuildUpdateContext) GetExtra() interface{}
type GuildUpdateEventHandler ¶
type GuildUpdateEventHandler func(*GuildUpdateContext)
func (GuildUpdateEventHandler) Handle ¶
func (eh GuildUpdateEventHandler) Handle(i EventContext)
func (GuildUpdateEventHandler) New ¶
func (eh GuildUpdateEventHandler) New() EventContext
func (GuildUpdateEventHandler) Type ¶
func (eh GuildUpdateEventHandler) Type() string
type GuildUserListInfo ¶
type GuildUserListOption ¶
GuildUserListOption is the type for optional arguments for GuildUserList request.
func GuildUserListWithActiveTime ¶
func GuildUserListWithActiveTime(activeTime bool) GuildUserListOption
GuildUserListWithActiveTime adds optional `active_time` argument to GuildUserList request.
func GuildUserListWithChannelID ¶
func GuildUserListWithChannelID(id string) GuildUserListOption
GuildUserListWithChannelID adds optional `channel_id` argument to GuildUserList request.
func GuildUserListWithJoinedAt ¶
func GuildUserListWithJoinedAt(joinedAt bool) GuildUserListOption
GuildUserListWithJoinedAt adds optional `joined_at` argument to GuildUserList request.
func GuildUserListWithMobileVerified ¶
func GuildUserListWithMobileVerified(verified bool) GuildUserListOption
GuildUserListWithMobileVerified adds optional `mobile_verified` argument to GuildUserList request.
func GuildUserListWithRoleID ¶
func GuildUserListWithRoleID(roleID int64) GuildUserListOption
GuildUserListWithRoleID adds optional `role_id` argument to GuildUserList request.
func GuildUserListWithSearch ¶
func GuildUserListWithSearch(search string) GuildUserListOption
GuildUserListWithSearch adds optional `search` argument to GuildUserList request.
type Identify ¶
type Identify struct {
Token string
Compress bool
WebsocketKey []byte
ClientID string
ClientSecret string
VerifyToken string
}
Identify is the struct for the initial settings sent to kookapp.
type ImageMessageContext ¶
type ImageMessageContext struct {
*EventHandlerCommonContext
Extra EventRichMessage
}
func (*ImageMessageContext) GetCommon ¶
func (ctx *ImageMessageContext) GetCommon() *EventHandlerCommonContext
func (*ImageMessageContext) GetExtra ¶
func (ctx *ImageMessageContext) GetExtra() interface{}
type ImageMessageEventHandler ¶
type ImageMessageEventHandler func(*ImageMessageContext)
func (ImageMessageEventHandler) Handle ¶
func (eh ImageMessageEventHandler) Handle(i EventContext)
func (ImageMessageEventHandler) New ¶
func (eh ImageMessageEventHandler) New() EventContext
func (ImageMessageEventHandler) Type ¶
func (eh ImageMessageEventHandler) Type() string
type IntBool ¶
type IntBool bool
IntBool is the type for some int value in response which only has two valid values.
func (*IntBool) MarshalJSON ¶
MarshalJSON is used to marshal IntBool for reqeust.
func (*IntBool) UnmarshalJSON ¶
UnmarshalJSON is used to unmarshal IntBool from response.
type IntimacyIndexResp ¶
type IntimacyIndexResp struct {
ImgURL string `json:"img_url"`
SocialInfo string `json:"social_info"`
LastRead MilliTimeStamp `json:"last_read"`
Score int `json:"score"`
ImgList []struct {
ID string `json:"id"`
URL string `json:"url"`
} `json:"img_list"`
}
IntimacyIndexResp is the type for intimacy info.
type IntimacyUpdate ¶
type IntimacyUpdate struct {
UserID string `json:"user_id"`
Score *int `json:"score,omitempty"`
SocialInfo string `json:"social_info,omitempty"`
ImgID int `json:"img_id,omitempty"`
}
IntimacyUpdate is the type for arguments for IntimacyUpdate request.
type InviteCreate ¶
type InviteCreate struct {
GuildID string `json:"guild_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Duration InviteDuration `json:"duration,omitempty"`
SettingTimes InviteSettingTimes `json:"setting_times,omitempty"`
}
InviteCreate is the type for arguments of InviteCreate request.
type InviteDelete ¶
type InviteDelete struct {
GuildID string `json:"guild_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
URLCode string `json:"url_code"`
}
InviteDelete is the type for arguments of InviteDelete request.
type InviteDuration ¶
type InviteDuration string
InviteDuration is the type for Duration in InviteCreate
You MUST use the enum defined below.
const ( InviteDurationInfinity InviteDuration = "0" InviteDurationHalfHour InviteDuration = "1800" InviteDurationHour InviteDuration = "3600" InviteDurationSixHour InviteDuration = "21600" InviteDurationTwelveHour InviteDuration = "43200" InviteDurationDay InviteDuration = "86400" InviteDurationWeek InviteDuration = "604800" )
These are allowed InviteDuration enums. You MUST use them.
type InviteListOption ¶
InviteListOption is the optional arguments for InviteList requests.
func InviteListWithChannelID ¶
func InviteListWithChannelID(channelID string) InviteListOption
InviteListWithChannelID adds optional `channel_id` argument to InviteList request.
func InviteListWithGuildID ¶
func InviteListWithGuildID(guildID string) InviteListOption
InviteListWithGuildID adds optional `guild_id` argument to InviteList request.
type InviteListResp ¶
type InviteListResp struct {
GuildID string `json:"guild_id"`
ChannelID string `json:"channel_id"`
URLCode string `json:"url_code"`
URL string `json:"url"`
User User `json:"user"`
}
InviteListResp is the type for response of InviteList request.
type InviteSettingTimes ¶
type InviteSettingTimes int
InviteSettingTimes is the type for SettingTimes in InviteCreate
You SHOULD use the enum defined below.
const ( InviteSettingTimesInfinity InviteSettingTimes = -1 InviteSettingTimesOne InviteSettingTimes = 1 InviteSettingTimesFive InviteSettingTimes = 5 InviteSettingTimesTen InviteSettingTimes = 10 InviteSettingTimesTwentyFive InviteSettingTimes = 25 InviteSettingTimesFifty InviteSettingTimes = 50 InviteSettingTimesHundred InviteSettingTimes = 100 )
These are allowed InviteSettingTimes enums. You SHOULD use them.
type KmarkdownMessageContext ¶
type KmarkdownMessageContext struct {
*EventHandlerCommonContext
Extra EventCustomMessage
}
func (*KmarkdownMessageContext) GetCommon ¶
func (ctx *KmarkdownMessageContext) GetCommon() *EventHandlerCommonContext
func (*KmarkdownMessageContext) GetExtra ¶
func (ctx *KmarkdownMessageContext) GetExtra() interface{}
type KmarkdownMessageEventHandler ¶
type KmarkdownMessageEventHandler func(*KmarkdownMessageContext)
func (KmarkdownMessageEventHandler) Handle ¶
func (eh KmarkdownMessageEventHandler) Handle(i EventContext)
func (KmarkdownMessageEventHandler) New ¶
func (eh KmarkdownMessageEventHandler) New() EventContext
func (KmarkdownMessageEventHandler) Type ¶
func (eh KmarkdownMessageEventHandler) Type() string
type Logger ¶
type Logger interface {
Trace() Entry
Debug() Entry
Info() Entry
Warn() Entry
Error() Entry
Fatal() Entry
}
Logger is the interface which external loggers should meet.
type MessageButtonClickContext ¶
type MessageButtonClickContext struct {
*EventHandlerCommonContext
Extra struct {
MsgID string `json:"msg_id"`
UserID string `json:"user_id"`
Value string `json:"value"`
TargetID string `json:"target_id"`
GuildID string `json:"guild_id"`
UserInfo User `json:"user_info"`
}
}
func (*MessageButtonClickContext) GetCommon ¶
func (ctx *MessageButtonClickContext) GetCommon() *EventHandlerCommonContext
func (*MessageButtonClickContext) GetExtra ¶
func (ctx *MessageButtonClickContext) GetExtra() interface{}
type MessageButtonClickEventHandler ¶
type MessageButtonClickEventHandler func(*MessageButtonClickContext)
func (MessageButtonClickEventHandler) Handle ¶
func (eh MessageButtonClickEventHandler) Handle(i EventContext)
func (MessageButtonClickEventHandler) New ¶
func (eh MessageButtonClickEventHandler) New() EventContext
func (MessageButtonClickEventHandler) Type ¶
func (eh MessageButtonClickEventHandler) Type() string
type MessageCreate ¶
type MessageCreate struct {
MessageCreateBase
TempTargetID string `json:"temp_target_id,omitempty"`
}
MessageCreate is the type for message creation arguments.
type MessageCreateBase ¶
type MessageCreateBase struct {
Type MessageType `json:"type,omitempty"`
TargetID string `json:"target_id,omitempty"`
Content string `json:"content,omitempty"`
Quote string `json:"quote,omitempty"`
Nonce string `json:"nonce,omitempty"`
}
MessageCreateBase is the common arguments for message creation.
type MessageCreateOption ¶
type MessageCreateOption func(*MessageCreate)
MessageCreateOption is the type for decorator of MessageCreate.
func MessageCreateWithCard ¶
func MessageCreateWithCard() MessageCreateOption
MessageCreateWithCard changes message type to card.
func MessageCreateWithKmarkdown ¶
func MessageCreateWithKmarkdown() MessageCreateOption
MessageCreateWithKmarkdown changes message type to Kmarkdown.
type MessageDeleteContext ¶
type MessageDeleteContext struct {
*EventHandlerCommonContext
Extra struct {
MsgID string `json:"msg_id"`
ChannelID string `json:"channel_id"`
}
}
func (*MessageDeleteContext) GetCommon ¶
func (ctx *MessageDeleteContext) GetCommon() *EventHandlerCommonContext
func (*MessageDeleteContext) GetExtra ¶
func (ctx *MessageDeleteContext) GetExtra() interface{}
type MessageDeleteEventHandler ¶
type MessageDeleteEventHandler func(*MessageDeleteContext)
func (MessageDeleteEventHandler) Handle ¶
func (eh MessageDeleteEventHandler) Handle(i EventContext)
func (MessageDeleteEventHandler) New ¶
func (eh MessageDeleteEventHandler) New() EventContext
func (MessageDeleteEventHandler) Type ¶
func (eh MessageDeleteEventHandler) Type() string
type MessageListFlag ¶
type MessageListFlag string
MessageListFlag is the type for the flag of MessageList.
const ( MessageListFlagBefore MessageListFlag = "before" MessageListFlagAround MessageListFlag = "around" MessageListFlagAfter MessageListFlag = "after" )
These are the usable flags
type MessageListOption ¶
MessageListOption is the type for optional arguments for MessageList request.
func MessageListWithFlag ¶
func MessageListWithFlag(flag MessageListFlag) MessageListOption
MessageListWithFlag adds optional `flag` argument to MessageList request.
func MessageListWithMsgID ¶
func MessageListWithMsgID(msgID string) MessageListOption
MessageListWithMsgID adds optional `msg_id` argument to MessageList request.
func MessageListWithPageSize ¶ added in v0.0.32
func MessageListWithPageSize(size int) MessageListOption
MessageListWithPageSize adds optional `page_size` argument to MessageList request.
func MessageListWithPin ¶
func MessageListWithPin(pin bool) MessageListOption
MessageListWithPin adds optional `pin` argument to MessageList request.
type MessagePinContext ¶
type MessagePinContext struct {
*EventHandlerCommonContext
Extra EventPinMessageItem
}
func (*MessagePinContext) GetCommon ¶
func (ctx *MessagePinContext) GetCommon() *EventHandlerCommonContext
func (*MessagePinContext) GetExtra ¶
func (ctx *MessagePinContext) GetExtra() interface{}
type MessagePinEventHandler ¶
type MessagePinEventHandler func(*MessagePinContext)
func (MessagePinEventHandler) Handle ¶
func (eh MessagePinEventHandler) Handle(i EventContext)
func (MessagePinEventHandler) New ¶
func (eh MessagePinEventHandler) New() EventContext
func (MessagePinEventHandler) Type ¶
func (eh MessagePinEventHandler) Type() string
type MessageReaction ¶
type MessageReaction struct {
MsgID string `json:"msg_id"`
UserID string `json:"user_id"`
ChannelID string `json:"channel_id"`
ChatCode string `json:"chat_code"`
Emoji EmojiItem `json:"emoji"`
}
MessageReaction is the struct for reactions embedded to a message.
type MessageResp ¶
type MessageResp struct {
MsgID string `json:"msg_id"`
MsgTimestamp MilliTimeStamp `json:"msg_timestamp"`
Nonce string `json:"nonce"`
}
MessageResp is the type for response for MessageCreate.
type MessageType ¶
type MessageType uint8
MessageType is the type for messages from events.
const ( MessageTypeText MessageType = 1 + iota MessageTypeImage MessageTypeVideo MessageTypeFile MessageTypeAudio MessageType = 4 + iota MessageTypeKMarkdown MessageTypeCard MessageTypeSystem MessageType = 255 )
MessageType consts for event message type
type MessageUnpinContext ¶
type MessageUnpinContext struct {
*EventHandlerCommonContext
Extra EventPinMessageItem
}
func (*MessageUnpinContext) GetCommon ¶
func (ctx *MessageUnpinContext) GetCommon() *EventHandlerCommonContext
func (*MessageUnpinContext) GetExtra ¶
func (ctx *MessageUnpinContext) GetExtra() interface{}
type MessageUnpinEventHandler ¶
type MessageUnpinEventHandler func(*MessageUnpinContext)
func (MessageUnpinEventHandler) Handle ¶
func (eh MessageUnpinEventHandler) Handle(i EventContext)
func (MessageUnpinEventHandler) New ¶
func (eh MessageUnpinEventHandler) New() EventContext
func (MessageUnpinEventHandler) Type ¶
func (eh MessageUnpinEventHandler) Type() string
type MessageUpdate ¶
type MessageUpdate struct {
MessageUpdateBase
TempTargetID string `json:"temp_target_id,omitempty"`
}
MessageUpdate is the request data for MessageUpdate.
type MessageUpdateBase ¶
type MessageUpdateBase struct {
MsgID string `json:"msg_id"`
Content string `json:"content"`
Quote string `json:"quote,omitempty"`
}
MessageUpdateBase is the shared arguments for message update related requests.
type MessageUpdateContext ¶
type MessageUpdateContext struct {
*EventHandlerCommonContext
Extra struct {
UpdatedAt MilliTimeStamp `json:"updated_at"`
MsgID string `json:"msg_id"`
Content string `json:"content"`
ChannelID string `json:"channel_id"`
Mention []string `json:"mention"`
MentionAll bool `json:"mention_all"`
MentionHere bool `json:"mention_here"`
MentionRoles []int64 `json:"mention_roles"`
}
}
func (*MessageUpdateContext) GetCommon ¶
func (ctx *MessageUpdateContext) GetCommon() *EventHandlerCommonContext
func (*MessageUpdateContext) GetExtra ¶
func (ctx *MessageUpdateContext) GetExtra() interface{}
type MessageUpdateEventHandler ¶
type MessageUpdateEventHandler func(*MessageUpdateContext)
func (MessageUpdateEventHandler) Handle ¶
func (eh MessageUpdateEventHandler) Handle(i EventContext)
func (MessageUpdateEventHandler) New ¶
func (eh MessageUpdateEventHandler) New() EventContext
func (MessageUpdateEventHandler) Type ¶
func (eh MessageUpdateEventHandler) Type() string
type MessageWithAttachment ¶
type MessageWithAttachment struct {
Type MessageType `json:"type"`
Code string `json:"code"`
GuildID string `json:"guild_id"`
Attachments Attachment `json:"attachments"`
Author User `json:"author"`
}
MessageWithAttachment is a message with attachment.
type MilliTimeStamp ¶
type MilliTimeStamp int64
MilliTimeStamp is the timestamp used in kookapp API.
func MilliTimeStampOfTime ¶
func MilliTimeStampOfTime(t time.Time) MilliTimeStamp
MilliTimeStampOfTime converts the time.Time to MillTimeStamp
func (*MilliTimeStamp) ToTime ¶
func (t *MilliTimeStamp) ToTime() time.Time
ToTime converts the timestamp to golang's time.Time.
type MusicSoftware ¶
type MusicSoftware string
MusicSoftware is the types for predefined music software.
const ( MusicSoftwareCloudMusic MusicSoftware = "cloudmusic" MusicSoftwareQQMusic MusicSoftware = "qqmusic" MusicSoftwareKuGou MusicSoftware = "kugou" )
type PageInfo ¶
type PageInfo struct {
Page int `json:"page"`
PageTotal int `json:"page_total"`
PageSize int `json:"page_size"`
Total int `json:"total"`
}
PageInfo is the struct for page info in list GET responses.
type PageSetting ¶
type PageSetting struct {
Page *int `json:"page"`
PageSize *int `json:"page_size"`
Sort *string `json:"sort"`
}
PageSetting is the type for page setting in list GET request arguments.
type PermissionOverwrite ¶
type PermissionOverwrite struct {
RoleID int64 `json:"role_id"`
Allow RolePermission `json:"allow"`
Deny RolePermission `json:"deny"`
}
PermissionOverwrite is the struct for where needs to customize permission for a role in a channel.
type PrivateMessage ¶
type PrivateMessage struct {
MsgID string `json:"msg_id"`
AuthorID string `json:"author_id"`
TargetID string `json:"target_id"`
Content string `json:"content"`
ChatCode string `json:"chat_code"`
UpdatedAt MilliTimeStamp `json:"updated_at"`
DeletedAt MilliTimeStamp `json:"deleted_at"`
}
PrivateMessage is the struct for messages in direct chat.
type Quote ¶
type Quote struct {
ID string `json:"id"`
Type MessageType `json:"type"`
Content string `json:"content"`
CreateAt MilliTimeStamp `json:"create_at"`
Author *User `json:"author"`
RongID string `json:"rong_id"`
}
Quote is the struct for quotes in message events.
type ReactedUser ¶
type ReactedUser struct {
User
ReactionTime MilliTimeStamp `json:"reaction_time"`
TagInfo struct {
Color string `json:"color"`
Text string `json:"text"`
} `json:"tag_info"`
}
ReactedUser is the type for every user reacted to a specific message with a specific emoji.
type ReactionAddContext ¶
type ReactionAddContext struct {
*EventHandlerCommonContext
Extra EventReactionItem
}
func (*ReactionAddContext) GetCommon ¶
func (ctx *ReactionAddContext) GetCommon() *EventHandlerCommonContext
func (*ReactionAddContext) GetExtra ¶
func (ctx *ReactionAddContext) GetExtra() interface{}
type ReactionAddEventHandler ¶
type ReactionAddEventHandler func(*ReactionAddContext)
func (ReactionAddEventHandler) Handle ¶
func (eh ReactionAddEventHandler) Handle(i EventContext)
func (ReactionAddEventHandler) New ¶
func (eh ReactionAddEventHandler) New() EventContext
func (ReactionAddEventHandler) Type ¶
func (eh ReactionAddEventHandler) Type() string
type ReactionDeleteContext ¶
type ReactionDeleteContext struct {
*EventHandlerCommonContext
Extra EventReactionItem
}
func (*ReactionDeleteContext) GetCommon ¶
func (ctx *ReactionDeleteContext) GetCommon() *EventHandlerCommonContext
func (*ReactionDeleteContext) GetExtra ¶
func (ctx *ReactionDeleteContext) GetExtra() interface{}
type ReactionDeleteEventHandler ¶
type ReactionDeleteEventHandler func(*ReactionDeleteContext)
func (ReactionDeleteEventHandler) Handle ¶
func (eh ReactionDeleteEventHandler) Handle(i EventContext)
func (ReactionDeleteEventHandler) New ¶
func (eh ReactionDeleteEventHandler) New() EventContext
func (ReactionDeleteEventHandler) Type ¶
func (eh ReactionDeleteEventHandler) Type() string
type ReactionItem ¶
type ReactionItem struct {
Emoji EmojiItem `json:"emoji"`
Count int `json:"count"`
Me bool `json:"me"`
}
ReactionItem is the reactions for a emoji to a message.
type ReplyOption ¶
type ReplyOption string
ReplyOption is the type providing additional options to Message event reply.
const ( // ReplyOptionTemp let reply temporary. ReplyOptionTemp ReplyOption = "reply_option_temp" )
type RestError ¶
type RestError struct {
Code int `json:"code"`
Message string `json:"message"`
Data json.RawMessage `json:"data"`
}
RestError is the error type for errors from kook
type Role ¶
type Role struct {
RoleID int64 `json:"role_id"`
Name string `json:"name,omitempty"`
Color int `json:"color,omitempty"`
Position int `json:"position"`
Hoist IntBool `json:"hoist,omitempty"`
Mentionable IntBool `json:"mentionable,omitempty"`
Permissions RolePermission `json:"permissions,omitempty"`
}
Role is the struct for a role in the guild.
type RolePermission ¶
type RolePermission int64
RolePermission is the type for the permission of a user in guilds or channels.
const ( RolePermissionAdmin RolePermission = 1 << iota RolePermissionManageGuild RolePermissionViewAuditLog RolePermissionCreateInvite RolePermissionManageInvite RolePermissionManageChannel RolePermissionKickUser RolePermissionBanUser RolePermissionManageGuildEmoji RolePermissionChangeNickname RolePermissionManageRolePermission RolePermissionViewChannel RolePermissionSendMessage RolePermissionManageMessage RolePermissionUploadFile RolePermissionConnectVoice RolePermissionManageVoice RolePermissionMentionEveryone RolePermissionCreateReaction RolePermissionFollowReaction RolePermissionInvitedToVoice RolePermissionForceManualVoice RolePermissionFreeVoice RolePermissionVoice RolePermissionManageUserVoiceReceive RolePermissionManageUserVoiceCreate RolePermissionManageNickname RolePermissionPlayMusic )
These are the permission defined in system.
func (RolePermission) HasPermission ¶
func (r RolePermission) HasPermission(p RolePermission) bool
HasPermission checks if having the provided permission.
type Session ¶
type Session struct {
sync.RWMutex
Identify Identify
LastHeartbeatAck time.Time
LastHeartbeatSent time.Time
Client *http.Client
MaxRetry int
RetryTimeout time.Duration
ContentType string
Logger Logger
Sync bool
// contains filtered or unexported fields
}
Session is the struct for a bot session.
func New ¶
func New(token string, l Logger, o ...SessionOption) (s *Session)
New creates a kook session with default settings
func (*Session) AddHandler ¶
func (s *Session) AddHandler(h interface{}) func()
AddHandler adds event handlers to session, and provides additional type check.
func (*Session) AssetCreate ¶
AssetCreate uploads attachments to kook server.
FYI: https://developer.kookapp.cn/doc/http/asset#%E4%B8%8A%E4%BC%A0%E6%96%87%E4%BB%B6/%E5%9B%BE%E7%89%87
func (*Session) BadgeGuildUrl ¶
BadgeGuildUrl builds the url for guild badge.
func (*Session) BlacklistCreate ¶
func (s *Session) BlacklistCreate(bc *BlacklistCreate) (err error)
BlacklistCreate adds user to blacklist
FYI: https://developer.kookapp.cn/doc/http/blacklist#%E5%8A%A0%E5%85%A5%E9%BB%91%E5%90%8D%E5%8D%95
func (*Session) BlacklistDelete ¶
BlacklistDelete removes user from blacklist
FYI: https://developer.kookapp.cn/doc/http/blacklist#%E7%A7%BB%E9%99%A4%E9%BB%91%E5%90%8D%E5%8D%95
func (*Session) BlacklistList ¶
func (s *Session) BlacklistList(guildID string, page *PageSetting) (bi []*BlacklistItem, meta *PageInfo, err error)
BlacklistList lists the users in blacklist.
func (*Session) ChannelCreate ¶
func (s *Session) ChannelCreate(cc *ChannelCreate) (c *Channel, err error)
ChannelCreate creates a channel. FYI: https://developer.kookapp.cn/doc/http/channel#%E5%88%9B%E5%BB%BA%E9%A2%91%E9%81%93
func (*Session) ChannelDelete ¶
ChannelDelete deletes a channel. FYI: https://developer.kookapp.cn/doc/http/channel#%E5%88%A0%E9%99%A4%E9%A2%91%E9%81%93
func (*Session) ChannelList ¶
func (s *Session) ChannelList(guildID string, page *PageSetting) (cs []*Channel, meta *PageInfo, err error)
ChannelList lists all channels from a guild. FYI: https://developer.kookapp.cn/doc/http/channel#%E8%8E%B7%E5%8F%96%E9%A2%91%E9%81%93%E5%88%97%E8%A1%A8
func (*Session) ChannelMoveUsers ¶
ChannelMoveUsers moves users to a channel. FYI: https://developer.kookapp.cn/doc/http/channel#%E8%AF%AD%E9%9F%B3%E9%A2%91%E9%81%93%E4%B9%8B%E9%97%B4%E7%A7%BB%E5%8A%A8%E7%94%A8%E6%88%B7
func (*Session) ChannelRoleCreate ¶
func (s *Session) ChannelRoleCreate(crc *ChannelRoleCreate) (crcr *ChannelRoleCreateResp, err error)
ChannelRoleCreate creates a role for a channel FYI: https://developer.kookapp.cn/doc/http/channel#%E5%88%9B%E5%BB%BA%E9%A2%91%E9%81%93%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90
func (*Session) ChannelRoleDelete ¶
func (s *Session) ChannelRoleDelete(crd *ChannelRoleDelete) (err error)
ChannelRoleDelete deletes a role form channel setting. FYI: https://developer.kookapp.cn/doc/http/channel#%E5%88%A0%E9%99%A4%E9%A2%91%E9%81%93%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90
func (*Session) ChannelRoleIndex ¶
func (s *Session) ChannelRoleIndex(channelID string) (cr *ChannelRoleIndex, err error)
ChannelRoleIndex returns the role and permission list of the channel. FYI: https://developer.kookapp.cn/doc/http/channel#%E9%A2%91%E9%81%93%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90%E8%AF%A6%E6%83%85
func (*Session) ChannelRoleSync ¶ added in v0.0.34
ChannelRoleSync syncs the roles' permissions. FYI: https://developer.kookapp.cn/doc/http/channel#%E5%90%8C%E6%AD%A5%E9%A2%91%E9%81%93%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90
func (*Session) ChannelRoleUpdate ¶
func (s *Session) ChannelRoleUpdate(cru *ChannelRoleUpdate) (crur *ChannelRoleUpdateResp, err error)
ChannelRoleUpdate updates a role from channel setting. FYI: https://developer.kookapp.cn/doc/http/channel#%E6%9B%B4%E6%96%B0%E9%A2%91%E9%81%93%E8%A7%92%E8%89%B2%E6%9D%83%E9%99%90
func (*Session) ChannelUpdate ¶ added in v0.0.34
func (s *Session) ChannelUpdate(cu *ChannelUpdate) (c *Channel, err error)
ChannelUpdate updates a channel's settings. FYI: https://developer.kookapp.cn/doc/http/channel#%E7%BC%96%E8%BE%91%E9%A2%91%E9%81%93
func (*Session) ChannelUserGetJoinedChannel ¶
func (s *Session) ChannelUserGetJoinedChannel(guildID, userID string, page *PageSetting) (us []*UserInVoiceChannel, meta *PageInfo, err error)
ChannelUserGetJoinedChannel gets the user in voice channel
func (*Session) ChannelUserList ¶
ChannelUserList returns a list of users in a voice channel.
func (*Session) ChannelView ¶
func (s *Session) ChannelView(channelID string, options ...ChannelViewOption) (c *Channel, err error)
ChannelView returns the detailed information for a channel. FYI: https://developer.kookapp.cn/doc/http/channel#%E8%8E%B7%E5%8F%96%E9%A2%91%E9%81%93%E8%AF%A6%E6%83%85
func (*Session) CloseWithCode ¶
CloseWithCode closes a websocket connection with custom websocket closing code.
func (*Session) DirectMessageAddReaction ¶
DirectMessageAddReaction add a reaction to a message as the bot.
func (*Session) DirectMessageCreate ¶
func (s *Session) DirectMessageCreate(create *DirectMessageCreate) (mr *MessageResp, err error)
DirectMessageCreate creates a message in direct chat. FYI: https://developer.kookapp.cn/doc/http/direct-message#%E5%8F%91%E9%80%81%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) DirectMessageDelete ¶
DirectMessageDelete deletes a message in direct chat. FYI: https://developer.kookapp.cn/doc/http/direct-message#%E5%88%A0%E9%99%A4%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) DirectMessageDeleteReaction ¶
DirectMessageDeleteReaction deletes a reaction of a user from a message.
func (*Session) DirectMessageList ¶
func (s *Session) DirectMessageList(options ...DirectMessageListOption) (dmrs []*DirectMessageResp, err error)
DirectMessageList returns the messages in direct chat.
func (*Session) DirectMessageReactionList ¶
func (s *Session) DirectMessageReactionList(msgID, emoji string) (us []*ReactedUser, err error)
DirectMessageReactionList returns the list of the reacted users with a specific emoji to a message.
func (*Session) DirectMessageUpdate ¶
func (s *Session) DirectMessageUpdate(update *DirectMessageUpdate) (err error)
DirectMessageUpdate updates a message in direct chat. FYI: https://developer.kookapp.cn/doc/http/direct-message#%E6%9B%B4%E6%96%B0%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) DirectMessageView ¶ added in v0.0.34
func (s *Session) DirectMessageView(chatCode, msgID string) (dmr *DirectMessageResp, err error)
DirectMessageView returns the specified message. FYI: https://developer.kookapp.cn/doc/http/direct-message#%E8%8E%B7%E5%8F%96%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF%E8%AF%A6%E6%83%85
func (*Session) GameActivity ¶
GameActivity begins playing a game or music. Pass a GameActivityMusicBody to select music activity.
func (*Session) GameCreate ¶
func (s *Session) GameCreate(gc *GameCreate) (g *Game, err error)
GameCreate creates a new Game in kook.
func (*Session) GameDelete ¶
GameDelete deletes the Game info in kook
func (*Session) GameDeleteActivity ¶
GameDeleteActivity stops playing a game.
func (*Session) GameList ¶
func (s *Session) GameList(page *PageSetting, options ...GameListOption) (gs []*Game, meta *PageInfo, err error)
GameList lists the games registered.
func (*Session) GameUpdate ¶
func (s *Session) GameUpdate(gu *GameUpdate) (g *Game, err error)
GameUpdate updates the Game info in kook
func (*Session) Gateway ¶
Gateway returns the url for websocket gateway. FYI: https://developer.kookapp.cn/doc/http/gateway#%E8%8E%B7%E5%8F%96%E7%BD%91%E5%85%B3%E8%BF%9E%E6%8E%A5%E5%9C%B0%E5%9D%80
func (*Session) GuildBoostHistory ¶ added in v0.0.34
func (s *Session) GuildBoostHistory(guildID string, page *PageSetting, options ...GuildBoostHistoryOption) (hs []*GuildBoostHistoryItem, meta *PageInfo, err error)
GuildBoostHistory returns the boost history. FYI: https://developer.kookapp.cn/doc/http/guild#%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%8A%A9%E5%8A%9B%E5%8E%86%E5%8F%B2
func (*Session) GuildEmojiCreate ¶
func (s *Session) GuildEmojiCreate(name, guildID string, emoji []byte) (ger *GuildEmojiResp, err error)
GuildEmojiCreate uploads emoji to guild.
func (*Session) GuildEmojiDelete ¶
GuildEmojiDelete deletes an emoji from a guild.
func (*Session) GuildEmojiList ¶
func (s *Session) GuildEmojiList(guildID string, page *PageSetting) (gers []*GuildEmojiResp, meta *PageInfo, err error)
GuildEmojiList returns the list of emojis in a guild
func (*Session) GuildEmojiUpdate ¶
GuildEmojiUpdate updates an emoji's info in a guild.
func (*Session) GuildKickout ¶
GuildKickout force a user to leave a guild. FYI: https://developer.kookapp.cn/doc/http/guild#%E8%B8%A2%E5%87%BA%E6%9C%8D%E5%8A%A1%E5%99%A8
func (*Session) GuildLeave ¶
GuildLeave let the bot leave a guild. FYI: https://developer.kookapp.cn/doc/http/guild#%E7%A6%BB%E5%BC%80%E6%9C%8D%E5%8A%A1%E5%99%A8
func (*Session) GuildList ¶
func (s *Session) GuildList(page *PageSetting) (gs []*Guild, meta *PageInfo, err error)
GuildList returns a list of guild that bot joins. FYI: https://developer.kookapp.cn/doc/http/guild#%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E5%8A%A0%E5%85%A5%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%88%97%E8%A1%A8
func (*Session) GuildMuteCreate ¶
func (s *Session) GuildMuteCreate(gms *GuildMuteSetting) (err error)
GuildMuteCreate revokes a users privilege of using mic or headset. FYI: https://developer.kookapp.cn/doc/http/guild#%E6%B7%BB%E5%8A%A0%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%9D%99%E9%9F%B3%E6%88%96%E9%97%AD%E9%BA%A6
func (*Session) GuildMuteDelete ¶
func (s *Session) GuildMuteDelete(gms *GuildMuteSetting) (err error)
GuildMuteDelete re-grants a users privilege of using mic or headset. FYI: https://developer.kookapp.cn/doc/http/guild#%E5%88%A0%E9%99%A4%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%9D%99%E9%9F%B3%E6%88%96%E9%97%AD%E9%BA%A6
func (*Session) GuildMuteList ¶
func (s *Session) GuildMuteList(guildID string) (gml *GuildMuteList, err error)
GuildMuteList returns the list of users got mutes in mic or earphone. FYI: https://developer.kookapp.cn/doc/http/guild#%E6%9C%8D%E5%8A%A1%E5%99%A8%E9%9D%99%E9%9F%B3%E9%97%AD%E9%BA%A6%E5%88%97%E8%A1%A8
func (*Session) GuildNickname ¶
func (s *Session) GuildNickname(gn *GuildNickname) (err error)
GuildNickname changes the nickname of a user in a guild. FYI: https://developer.kookapp.cn/doc/http/guild#%E4%BF%AE%E6%94%B9%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E7%94%A8%E6%88%B7%E7%9A%84%E6%98%B5%E7%A7%B0
func (*Session) GuildRoleCreate ¶
GuildRoleCreate creates a role for a guild.
func (*Session) GuildRoleDelete ¶
GuildRoleDelete deletes a role from a guild.
func (*Session) GuildRoleGrant ¶
func (s *Session) GuildRoleGrant(guildID, userID string, roleID int64) (grr *GuildRoleResp, err error)
GuildRoleGrant grants a role to a user.
func (*Session) GuildRoleList ¶
func (s *Session) GuildRoleList(guildID string, page *PageSetting) (rs []*Role, meta *PageInfo, err error)
GuildRoleList returns the roles in a guild. FYI: https://developer.kookapp.cn/doc/http/guild-role#%E8%8E%B7%E5%8F%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%A7%92%E8%89%B2%E5%88%97%E8%A1%A8
func (*Session) GuildRoleRevoke ¶
func (s *Session) GuildRoleRevoke(guildID, userID string, roleID int64) (grr *GuildRoleResp, err error)
GuildRoleRevoke revokes a role from a user.
func (*Session) GuildRoleUpdate ¶
GuildRoleUpdate updates a role for a guild.
func (*Session) GuildUserList ¶
func (s *Session) GuildUserList(guildID string, page *PageSetting, options ...GuildUserListOption) (us []*User, guli *GuildUserListInfo, meta *PageInfo, err error)
GuildUserList returns the list of users in a guild. FYI: https://developer.kookapp.cn/doc/http/guild#%E8%8E%B7%E5%8F%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%AD%E7%9A%84%E7%94%A8%E6%88%B7%E5%88%97%E8%A1%A8
func (*Session) GuildView ¶
GuildView returns a detailed info for a guild. FYI: https://developer.kookapp.cn/doc/http/guild#%E8%8E%B7%E5%8F%96%E6%9C%8D%E5%8A%A1%E5%99%A8%E8%AF%A6%E6%83%85
func (*Session) IntimacyIndex ¶
func (s *Session) IntimacyIndex(userID string) (iir *IntimacyIndexResp, err error)
IntimacyIndex returns the intimacy info for a user.
func (*Session) IntimacyUpdate ¶
func (s *Session) IntimacyUpdate(iu *IntimacyUpdate) (err error)
IntimacyUpdate updates the intimacy info for a user.
func (*Session) InviteCreate ¶
func (s *Session) InviteCreate(ic *InviteCreate) (URL string, err error)
InviteCreate creates an invite link.
FYI: https://developer.kookapp.cn/doc/http/invite#%E5%88%9B%E5%BB%BA%E9%82%80%E8%AF%B7%E9%93%BE%E6%8E%A5
func (*Session) InviteDelete ¶
func (s *Session) InviteDelete(id *InviteDelete) (err error)
InviteDelete deletes an invite link.
FYI: https://developer.kookapp.cn/doc/http/invite#%E5%88%A0%E9%99%A4%E9%82%80%E8%AF%B7%E9%93%BE%E6%8E%A5
func (*Session) InviteList ¶
func (s *Session) InviteList(page *PageSetting, options ...InviteListOption) (ilrs []*InviteListResp, meta *PageInfo, err error)
InviteList lists invite links of a guild.
FYI: https://developer.kookapp.cn/doc/http/invite#%E8%8E%B7%E5%8F%96%E9%82%80%E8%AF%B7%E5%88%97%E8%A1%A8
func (*Session) MessageAddReaction ¶
MessageAddReaction add a reaction to a message as the bot. FYI: https://developer.kookapp.cn/doc/http/message#%E7%BB%99%E6%9F%90%E4%B8%AA%E6%B6%88%E6%81%AF%E6%B7%BB%E5%8A%A0%E5%9B%9E%E5%BA%94
func (*Session) MessageCreate ¶
func (s *Session) MessageCreate(m *MessageCreate) (resp *MessageResp, err error)
MessageCreate creates a message. FYI: https://developer.kookapp.cn/doc/http/message#%E5%8F%91%E9%80%81%E9%A2%91%E9%81%93%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) MessageDelete ¶
MessageDelete deletes a message. FYI: https://developer.kookapp.cn/doc/http/message#%E5%88%A0%E9%99%A4%E9%A2%91%E9%81%93%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) MessageDeleteReaction ¶
MessageDeleteReaction deletes a reaction of a user from a message. FYI: https://developer.kookapp.cn/doc/http/message#%E5%88%A0%E9%99%A4%E6%B6%88%E6%81%AF%E7%9A%84%E6%9F%90%E4%B8%AA%E5%9B%9E%E5%BA%94
func (*Session) MessageList ¶
func (s *Session) MessageList(targetID string, options ...MessageListOption) (ms []*DetailedChannelMessage, err error)
MessageList returns a list of messages of a channel. FYI: https://developer.kookapp.cn/doc/http/message#%E8%8E%B7%E5%8F%96%E9%A2%91%E9%81%93%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF%E5%88%97%E8%A1%A8
func (*Session) MessageReactionList ¶
func (s *Session) MessageReactionList(msgID, emoji string) (us []*ReactedUser, err error)
MessageReactionList returns the list of the reacted users with a specific emoji to a message. FYI: https://developer.kookapp.cn/doc/http/message#%E8%8E%B7%E5%8F%96%E9%A2%91%E9%81%93%E6%B6%88%E6%81%AF%E6%9F%90%E5%9B%9E%E5%BA%94%E7%9A%84%E7%94%A8%E6%88%B7%E5%88%97%E8%A1%A8
func (*Session) MessageUpdate ¶
func (s *Session) MessageUpdate(m *MessageUpdate) (err error)
MessageUpdate updates a message. FYI: https://developer.kookapp.cn/doc/http/message#%E6%9B%B4%E6%96%B0%E9%A2%91%E9%81%93%E8%81%8A%E5%A4%A9%E6%B6%88%E6%81%AF
func (*Session) MessageView ¶ added in v0.0.31
func (s *Session) MessageView(msgId string) (m *DetailedChannelMessage, err error)
MessageView returns a detailed message.
func (*Session) Request ¶
Request is the wrapper for internal request method, you would prefer to use other method other than this.
func (*Session) RequestWithPage ¶
func (s *Session) RequestWithPage(method, u string, page *PageSetting) (response []byte, meta *PageInfo, err error)
RequestWithPage is the wrapper for internal list GET request, you would prefer to use other method other than this.
func (*Session) UserChatCreate ¶
UserChatCreate creates a direct chat session. FYI: https://developer.kookapp.cn/doc/http/user-chat#%E5%88%9B%E5%BB%BA%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E4%BC%9A%E8%AF%9D
func (*Session) UserChatDelete ¶
UserChatDelete deletes a direct chat session. FYI: https://developer.kookapp.cn/doc/http/user-chat#%E5%88%9B%E5%BB%BA%E7%A7%81%E4%BF%A1%E8%81%8A%E5%A4%A9%E4%BC%9A%E8%AF%9D
func (*Session) UserChatList ¶
func (s *Session) UserChatList(page *PageSetting) (ucs []*UserChat, meta *PageInfo, err error)
UserChatList returns a list of user chats that bot owns.
Note: for User in TargetInfo, only ID, Username, Online, Avatar is filled
func (*Session) UserChatView ¶
UserChatView returns a detailed user chat.
func (*Session) UserMe ¶
UserMe returns the bot info. FYI: https://developer.kookapp.cn/doc/http/user#%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF
func (*Session) UserView ¶
func (s *Session) UserView(userID string, options ...UserViewOption) (u *User, err error)
UserView returns a user's info FYI: https://developer.kookapp.cn/doc/http/user#%E8%8E%B7%E5%8F%96%E7%9B%AE%E6%A0%87%E7%94%A8%E6%88%B7%E4%BF%A1%E6%81%AF
func (*Session) WebhookHandler ¶
func (s *Session) WebhookHandler() http.HandlerFunc
WebhookHandler provides a http.HandlerFunc for webhook.
type SessionOption ¶
type SessionOption func(*Session)
SessionOption is the optional arguments for creating a session.
func SessionWithEncryptKey ¶
func SessionWithEncryptKey(key []byte) SessionOption
SessionWithEncryptKey adds the key for decrypting webhook request.
func SessionWithVerifyToken ¶
func SessionWithVerifyToken(token string) SessionOption
SessionWithVerifyToken adds the token for verifying webhook request.
type TextMessageContext ¶
type TextMessageContext struct {
*EventHandlerCommonContext
Extra struct {
Author User `json:"author"`
Quote *Quote `json:"quote"`
GuildID string `json:"guild_id"`
ChannelName string `json:"channel_name"`
Mention []string `json:"mention"`
MentionAll bool `json:"mention_all"`
MentionRoles []int64 `json:"mention_roles"`
MentionHere bool `json:"mention_here"`
}
}
func (*TextMessageContext) GetCommon ¶
func (ctx *TextMessageContext) GetCommon() *EventHandlerCommonContext
func (*TextMessageContext) GetExtra ¶
func (ctx *TextMessageContext) GetExtra() interface{}
func (*TextMessageContext) Reply ¶
func (c *TextMessageContext) Reply(text string, options ...interface{}) (*MessageResp, error)
Reply is a helper function for replying to a message.
It accept optional MessageCreateOption, DirectMessageCreateOption and ReplyOption arguments.
type TextMessageEventHandler ¶
type TextMessageEventHandler func(*TextMessageContext)
func (TextMessageEventHandler) Handle ¶
func (eh TextMessageEventHandler) Handle(i EventContext)
func (TextMessageEventHandler) New ¶
func (eh TextMessageEventHandler) New() EventContext
func (TextMessageEventHandler) Type ¶
func (eh TextMessageEventHandler) Type() string
type User ¶
type User struct {
ID string `json:"id"`
Username string `json:"username"`
IdentifyNum string `json:"identify_num"`
Online bool `json:"online"`
Status UserStatus `json:"status"`
Avatar string `json:"avatar"`
VipAvatar string `json:"vip_avatar"`
Bot bool `json:"bot"`
// MobileVerified bool `json:"mobile_verified"`
System bool `json:"system"`
MobilePrefix string `json:"mobile_prefix"`
Mobile string `json:"mobile"`
InviteCount int64 `json:"invite_count"`
Nickname string `json:"nickname"`
Roles []int64 `json:"roles"`
FullName string `json:"full_name"`
IsVip bool `json:"is_vip"`
JoinedAt MilliTimeStamp `json:"joined_at"`
ActiveTime MilliTimeStamp `json:"active_time"`
Os string `json:"os"`
Banner string `json:"banner"`
}
User is the struct for a user. Some property may missing.
type UserChat ¶
type UserChat struct {
Code string `json:"code"`
LastReadTime MilliTimeStamp `json:"last_read_time"`
LatestMsgTime MilliTimeStamp `json:"latest_msg_time"`
UnreadCount int `json:"unread_count"`
IsFriend bool `json:"is_friend"`
IsBlocked bool `json:"is_blocked"`
IsTargetBlocked bool `json:"is_target_blocked"`
TargetInfo User `json:"target_info"`
}
UserChat is the struct for DirectMessage or UserChat
type UserInVoiceChannel ¶
type UserInVoiceChannel struct {
ID string `json:"id"`
GuildID string `json:"guild_id"`
MasterID string `json:"master_id"`
ParentID string `json:"parent_id"`
UserID string `json:"user_id"`
Name string `json:"name"`
Topic string `json:"topic"`
Type ChannelType `json:"type"`
Level int `json:"level"`
SlowMode int `json:"slow_mode"`
LimitAmount int `json:"limit_amount"`
IsCategory bool `json:"is_category"`
PermissionOverwrites []PermissionOverwrite `json:"permission_overwrites"`
PermissionUsers []UserPermissionOverwrite `json:"permission_users"`
PermissionSync IntBool `json:"permission_sync"`
}
UserInVoiceChannel is a user in a voice channel
type UserPermissionOverwrite ¶
type UserPermissionOverwrite struct {
User *User `json:"user"`
Allow RolePermission `json:"allow"`
Deny RolePermission `json:"deny"`
}
UserPermissionOverwrite is the struct for where needs to customize permission for a user in a channel.
type UserStatus ¶
type UserStatus int8
UserStatus is the type for user status(banned or not).
const ( UserStatusNormal UserStatus = 1 UserStatusBanned UserStatus = 10 )
These are all the status of a user.
func (UserStatus) IsBanned ¶
func (r UserStatus) IsBanned() bool
IsBanned checks if the user is banned.
type UserUpdateContext ¶
type UserUpdateContext struct {
*EventHandlerCommonContext
Extra struct {
UserID string `json:"user_id"`
Username string `json:"username"`
Avatar string `json:"avatar"`
}
}
func (*UserUpdateContext) GetCommon ¶
func (ctx *UserUpdateContext) GetCommon() *EventHandlerCommonContext
func (*UserUpdateContext) GetExtra ¶
func (ctx *UserUpdateContext) GetExtra() interface{}
type UserUpdateEventHandler ¶
type UserUpdateEventHandler func(*UserUpdateContext)
func (UserUpdateEventHandler) Handle ¶
func (eh UserUpdateEventHandler) Handle(i EventContext)
func (UserUpdateEventHandler) New ¶
func (eh UserUpdateEventHandler) New() EventContext
func (UserUpdateEventHandler) Type ¶
func (eh UserUpdateEventHandler) Type() string
type UserViewOption ¶
UserViewOption is the optional arguments for UserView requests.
func UserViewWithGuildID ¶
func UserViewWithGuildID(guildID string) UserViewOption
UserViewWithGuildID add the optional `guild_id` arguments to UserView request
type VideoMessageContext ¶
type VideoMessageContext struct {
*EventHandlerCommonContext
Extra EventRichMessage
}
func (*VideoMessageContext) GetCommon ¶
func (ctx *VideoMessageContext) GetCommon() *EventHandlerCommonContext
func (*VideoMessageContext) GetExtra ¶
func (ctx *VideoMessageContext) GetExtra() interface{}
type VideoMessageEventHandler ¶
type VideoMessageEventHandler func(*VideoMessageContext)
func (VideoMessageEventHandler) Handle ¶
func (eh VideoMessageEventHandler) Handle(i EventContext)
func (VideoMessageEventHandler) New ¶
func (eh VideoMessageEventHandler) New() EventContext
func (VideoMessageEventHandler) Type ¶
func (eh VideoMessageEventHandler) Type() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
module
|
|
|
log_adapter
|
|
|
plog
module
|
|
|
zap
module
|
|
|
tools
|
|
|
cmd/eventhandler
module
|