Versions in this module Expand all Collapse all v0 v0.0.1 Dec 2, 2019 Changes in this version + func NewFileBase64(file interface{}) (string, error) + func NewFileLocal(file string) string + func NewImageBase64(file interface{}) (*cqcode.Image, error) + func NewImageLocal(file string) *cqcode.Image + func NewRecordBase64(file interface{}) (*cqcode.Record, error) + func NewRecordLocal(file string) *cqcode.Record + type APIResponse struct + Data json.RawMessage + Echo interface{} + RetCode int + Status string + type BaseChat struct + ChatID int64 + ChatType string + type BaseUpdateConfig struct + PreloadUserInfo bool + type BotAPI struct + APIEndpoint string + Buffer int + Client *http.Client + Debug bool + Echo int + EchoMux sync.Mutex + Secret string + Self User + Token string + WSAPIClient *websocket.Conn + WSEventClient *websocket.Conn + WSPendingMux sync.Mutex + WSPendingRequests map[int]chan APIResponse + WSRequestTimeout time.Duration + func NewBotAPI(token string, api string, secret string) (*BotAPI, error) + func NewBotAPIWithClient(token string, api string, secret string) (*BotAPI, error) + func NewBotAPIWithWSClient(token string, api string) (*BotAPI, error) + func (bot *BotAPI) DeleteMessage(messageID int64) (APIResponse, error) + func (bot *BotAPI) Do(c Chattable) (APIResponse, error) + func (bot *BotAPI) EnableAnonymousChat(groupID int64, enable bool) (APIResponse, error) + func (bot *BotAPI) GetGroupList() ([]Group, error) + func (bot *BotAPI) GetGroupMemberInfo(groupID int64, userID int64, noCache bool) (User, error) + func (bot *BotAPI) GetGroupMemberList(groupID int64) ([]User, error) + func (bot *BotAPI) GetMe() (User, error) + func (bot *BotAPI) GetStrangerInfo(userID int64) (User, error) + func (bot *BotAPI) GetUpdates(config UpdateConfig) ([]Update, error) + func (bot *BotAPI) GetUpdatesChan(config UpdateConfig) (UpdatesChannel, error) + func (bot *BotAPI) HandleFriendRequest(flag string, approve bool, remark string) (APIResponse, error) + func (bot *BotAPI) HandleGroupRequest(flag string, typ string, approve bool, reason string) (APIResponse, error) + func (bot *BotAPI) IsMessageToMe(message Message) bool + func (bot *BotAPI) KickChatMember(groupID int64, userID int64, rejectAddRequest bool) (APIResponse, error) + func (bot *BotAPI) LeaveChat(chatID int64, chatType string, dismiss bool) (APIResponse, error) + func (bot *BotAPI) Like(userID int64, times int) (APIResponse, error) + func (bot *BotAPI) ListenForWebSocket(config WebhookConfig) UpdatesChannel + func (bot *BotAPI) ListenForWebhook(config WebhookConfig) UpdatesChannel + func (bot *BotAPI) ListenForWebhookSync(config WebhookConfig, handler func(update Update) interface{}) + func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) + func (bot *BotAPI) NewMessage(chatID int64, chatType string) *Sender + func (bot *BotAPI) PreloadUserInfo(update *Update) + func (bot *BotAPI) PromoteChatMember(groupID int64, userID int64, enable bool) (APIResponse, error) + func (bot *BotAPI) RestrictAllChatMembers(groupID int64, enable bool) (APIResponse, error) + func (bot *BotAPI) RestrictAnonymousChatMember(groupID int64, flag string, duration time.Duration) (APIResponse, error) + func (bot *BotAPI) RestrictChatMember(groupID int64, userID int64, duration time.Duration) (APIResponse, error) + func (bot *BotAPI) Send(c Chattable) (Message, error) + func (bot *BotAPI) SendMessage(chatID int64, chatType string, message interface{}) (Message, error) + func (bot *BotAPI) SetChatMemberCard(groupID int64, userID int64, card string) (APIResponse, error) + func (bot *BotAPI) SetChatMemberTitle(groupID int64, userID int64, title string, duration time.Duration) (APIResponse, error) + type Chat struct + ID int64 + SubType string + Type string + func (c Chat) IsDiscuss() bool + func (c Chat) IsGroup() bool + func (c Chat) IsPrivate() bool + type ChatMemberConfig struct + AnonymousFlag string + GroupID int64 + UserID int64 + type Chattable interface + type DeleteMessageConfig struct + MessageID int64 + type EnableAnonymousChatConfig struct + type File struct + BusID int64 + ID string + Name string + Size int64 + type FlatSender struct + ChatID int64 + ChatType string + Err error + Result *Message + func (sender *FlatSender) At(QQ string) *FlatSender + func (sender *FlatSender) Emoji(emojiID int) *FlatSender + func (sender *FlatSender) Face(faceID int) *FlatSender + func (sender *FlatSender) FaceByName(faceName string) *FlatSender + func (sender *FlatSender) ImageBase64(file interface{}) *FlatSender + func (sender *FlatSender) ImageLocal(file string) *FlatSender + func (sender *FlatSender) ImageWeb(url *url.URL) *FlatSender + func (sender *FlatSender) NewLine() *FlatSender + func (sender *FlatSender) Send() *Sender + func (sender *FlatSender) Sface(sfaceID int) *FlatSender + func (sender *FlatSender) Text(text string) *FlatSender + type Group struct + ID int64 + Name string + type GroupControlConfig struct + Enable bool + GroupID int64 + type HandleFriendRequestConfig struct + Remark string + type HandleGroupRequestConfig struct + Reason string + Type string + type HandleRequestConfig struct + Approve bool + RequestFlag string + type KickChatMemberConfig struct + RejectAddRequest bool + type LeaveChatConfig struct + IsDismiss bool + type LikeConfig struct + Times int + UserID int64 + type Message struct + Chat *Chat + Font int + From *User + MessageID int64 + SubType string + Text string + func (m Message) IsAnonymous() bool + func (m Message) IsNotice() bool + type MessageConfig struct + AutoEscape bool + Text string + func NewMessage(chatID int64, chatType string, message interface{}) MessageConfig + type NetImage struct + func NewImageWeb(url *url.URL) *NetImage + type NetRecord struct + func NewRecordWeb(url *url.URL) *NetRecord + type NetResource struct + Cache int + func (r *NetResource) DisableCache() + func (r *NetResource) EnableCache() + type PromoteChatMemberConfig struct + Enable bool + type RestrictAllChatMembersConfig struct + type RestrictChatMemberConfig struct + Duration time.Duration + type Sender struct + func NewSender(bot *BotAPI, chatID int64, chatType string) *Sender + func (sender *Sender) Bface(bfaceID int) *Sender + func (sender *Sender) Dice() *Sender + func (sender *Sender) Location(loc cqcode.Location) *Sender + func (sender *Sender) Music(music cqcode.Music) *Sender + func (sender *Sender) RecordBase64(file interface{}, magic bool) *Sender + func (sender *Sender) RecordLocal(file string, magic bool) *Sender + func (sender *Sender) RecordWeb(url *url.URL, magic bool) *Sender + func (sender *Sender) Rps() *Sender + func (sender *Sender) Shake(emojiID int) *Sender + func (sender *Sender) Share(share cqcode.Share) *Sender + func (sender *Sender) Show(id int) *Sender + func (sender *Sender) Sign(sign cqcode.Sign) *Sender + type SetChatMemberCardConfig struct + Card string + type SetChatMemberTitleConfig struct + Duration time.Duration + SpecialTitle string + type Update struct + Anonymous interface{} + AnonymousFlag string + DiscussID int64 + Event string + File *File + Flag string + Font int + GroupID int64 + Message *Message + MessageID int64 + MessageType string + NoticeType string + OperatorID int64 + PostType string + RawMessage interface{} + RequestType string + Sender *User + SubType string + Text string + Time int64 + UserID int64 + func (update *Update) ParseRawMessage() + type UpdateConfig struct + Limit int + Offset int + Timeout int + func NewUpdate(offset int) UpdateConfig + type UpdatesChannel <-chan Update + type User struct + Age int + AnonymousFlag string + AnonymousID int64 + AnonymousName string + Area string + Card string + CardChangeable bool + ID int64 + JoinTimeUnix int64 + LastSentTimeUnix int64 + Level string + NickName string + Role string + Sex string + Title string + TitleExpireTimeUnix int64 + Unfriendly bool + func (u *User) Name() string + func (u *User) String() string + type WebSocketRequest struct + Action string + Echo interface{} + Params map[string]interface{} + type WebhookConfig struct + Pattern string + func NewWebhook(pattern string) WebhookConfig