Documentation ¶
Index ¶
- func ReleaseCtx(c *Ctx)
- type Ctx
- func (context *Ctx) AddMemberToGroup(jids []waTypes.JID) error
- func (context *Ctx) Arguments() []string
- func (context *Ctx) ByteToMessage(value []byte, withReply bool, caption string) *waProto.Message
- func (context *Ctx) ChatJID() waTypes.JID
- func (context *Ctx) Client() *whatsmeow.Client
- func (context *Ctx) ClientJID() waTypes.JID
- func (context *Ctx) DelLocals(key string)
- func (context *Ctx) DemoteMemberInGroup(jids []waTypes.JID) error
- func (context *Ctx) Download(quoted bool) ([]byte, error)
- func (context *Ctx) DownloadMessage(message *waProto.Message, quoted bool) ([]byte, error)
- func (context *Ctx) DownloadMessageToFile(message *waProto.Message, quoted bool, fileName string) (*os.File, error)
- func (context *Ctx) DownloadToFile(quoted bool, fileName string) (*os.File, error)
- func (context *Ctx) EditMessageText(to string) error
- func (context *Ctx) FindGroupByJid(groupJid waTypes.JID) (group *waTypes.GroupInfo, err error)
- func (context *Ctx) FindMessageByID(jid waTypes.JID, id string) *events.Message
- func (context *Ctx) FromMe() bool
- func (context *Ctx) GenerateReplyMessage(obj any) *waProto.Message
- func (context *Ctx) GetAllChats() []*events.Message
- func (context *Ctx) GetAllGroups() (group []*waTypes.GroupInfo, err error)
- func (context *Ctx) GetChatInJID(jid waTypes.JID) []*events.Message
- func (context *Ctx) GetDownloadable(quoted bool) *waProto.Message
- func (context *Ctx) GetDownloadableMessage(message *waProto.Message, quoted bool) *waProto.Message
- func (context *Ctx) GetGroupInfo(jid any) (*waTypes.GroupInfo, error)
- func (context *Ctx) GetGroupInfoFromInviteLink(link string) (*waTypes.GroupInfo, error)
- func (context *Ctx) GetGroupInviteLink(jid any) (string, error)
- func (context *Ctx) GetGroupProfilePicture(jid any) (string, error)
- func (context *Ctx) GetJoinedGroups() ([]*waTypes.GroupInfo, error)
- func (context *Ctx) GetLocals(key string) (string, bool)
- func (context *Ctx) GetStatusMessages() []*events.Message
- func (context *Ctx) GetUserInfo(jid any) (result waTypes.UserInfo, err error)
- func (context *Ctx) IsClientGroupAdmin() (bool, error)
- func (context *Ctx) IsGroupAdmin(jid any) (bool, error)
- func (context *Ctx) JoinGroupInviteLink(link string) error
- func (context *Ctx) LeaveFromGroup(jid waTypes.JID) error
- func (context *Ctx) LeaveFromThisGroup() error
- func (context *Ctx) Logger() waLog.Logger
- func (context *Ctx) Message() *waProto.Message
- func (context *Ctx) MessageEvent() *events.Message
- func (context *Ctx) MessageInfo() waTypes.MessageInfo
- func (context *Ctx) Methods() types.ClientMethods
- func (context *Ctx) NewPollingState() *PollingState
- func (context *Ctx) NewUserQuestion() *QuestionState
- func (context *Ctx) Number() string
- func (context *Ctx) Options() *options.Options
- func (context *Ctx) ParsedMsg() string
- func (context *Ctx) Prefix() string
- func (context *Ctx) PromoteMemberInGroup(jids []waTypes.JID) error
- func (context *Ctx) RangeLocals(fun func(key string, value string) bool)
- func (context *Ctx) RemoveMemberFromGroup(jids []waTypes.JID) error
- func (context *Ctx) RevokeGroupInvite() (string, error)
- func (context *Ctx) RevokeMessage(jid waTypes.JID, messageId waTypes.MessageID)
- func (context *Ctx) SendEmoji(emoji string)
- func (context *Ctx) SendMessage(obj any)
- func (context *Ctx) SendReadPresence()
- func (context *Ctx) SendReplyMessage(obj any)
- func (context *Ctx) SendTypingPresence(duration time.Duration)
- func (context *Ctx) SenderJID() waTypes.JID
- func (context *Ctx) SetClient(client *whatsmeow.Client)
- func (context *Ctx) SetClientJID(jid waTypes.JID)
- func (context *Ctx) SetClientMethods(clientMethods types.ClientMethods)
- func (context *Ctx) SetGroupAnnounce(announce bool) error
- func (context *Ctx) SetGroupLocked(locked bool) error
- func (context *Ctx) SetGroupName(name string) error
- func (context *Ctx) SetGroupPhoto(data []byte) error
- func (context *Ctx) SetLocals(key string, value string)
- func (context *Ctx) SetLocalsWithTTL(key string, value string, ttl time.Duration)
- func (context *Ctx) SetLogger(logger waLog.Logger)
- func (context *Ctx) SetMessageEvent(evt *events.Message)
- func (context *Ctx) SetOptions(options *options.Options)
- func (context *Ctx) SetParsedMsg(parsedMsg string)
- func (context *Ctx) SetPollingChan(pooling chan *PollingState)
- func (context *Ctx) SetPrefix(prefix string)
- func (context *Ctx) SetQuestionChan(question chan *QuestionState)
- func (context *Ctx) SetUserStatus(status string) error
- func (context *Ctx) UpdateClientProfilePicture(data []byte) error
- func (context *Ctx) UpdateGroupProfilePicture(jid any, data []byte) error
- func (context *Ctx) UploadAudioFromUrl(url string) (*waProto.AudioMessage, error)
- func (context *Ctx) UploadAudioMessageFromBytes(bytes []byte) (*waProto.AudioMessage, error)
- func (context *Ctx) UploadAudioMessageFromPath(path string) (*waProto.AudioMessage, error)
- func (context *Ctx) UploadBytesMedia(bytes []byte, vars map[string]string) (any, error)
- func (context *Ctx) UploadDocumentFromUrl(url, title, filename string) (*waProto.DocumentMessage, error)
- func (context *Ctx) UploadDocumentMessageFromBytes(bytes []byte, title, filename string) (*waProto.DocumentMessage, error)
- func (context *Ctx) UploadDocumentMessageFromPath(path, title string) (*waProto.DocumentMessage, error)
- func (context *Ctx) UploadImageFromUrl(url, caption string) (*waProto.ImageMessage, error)
- func (context *Ctx) UploadImageMessageFromBytes(bytes []byte, caption string) (*waProto.ImageMessage, error)
- func (context *Ctx) UploadImageMessageFromPath(path, caption string) (*waProto.ImageMessage, error)
- func (context *Ctx) UploadMediaFromUrl(url string, vars map[string]string) (any, error)
- func (context *Ctx) UploadStickerFromUrl(url string) (*waProto.StickerMessage, error)
- func (context *Ctx) UploadStickerMessageFromBytes(bytes []byte) (*waProto.StickerMessage, error)
- func (context *Ctx) UploadStickerMessageFromPath(path string) (*waProto.StickerMessage, error)
- func (context *Ctx) UploadVideoFromUrl(url, caption string) (*waProto.VideoMessage, error)
- func (context *Ctx) UploadVideoMessageFromBytes(bytes []byte, caption string) (*waProto.VideoMessage, error)
- func (context *Ctx) UploadVideoMessageFromPath(path, caption string) (*waProto.VideoMessage, error)
- type MiddlewareFunc
- type PollingOptions
- type PollingState
- func (p *PollingState) Exec() []string
- func (p *PollingState) SetOnlyOnePool() *PollingState
- func (p *PollingState) SetPollInformation(name string, options []string) *PollingState
- func (p *PollingState) SetSelectableOption(count int) *PollingState
- func (p *PollingState) SetTimeBasedType(timeOut time.Duration) *PollingState
- func (p *PollingState) WithRevoke() *PollingState
- type QuestionState
- func (state *QuestionState) CaptureMediaQuestion(question string, answer **waProto.Message) *QuestionState
- func (state *QuestionState) CaptureQuestion(question string, answer **waProto.Message) *QuestionState
- func (state *QuestionState) Exec()
- func (state *QuestionState) ExecWithParser()
- func (state *QuestionState) NoAskCaptureMediaQuestion(answer **waProto.Message) *QuestionState
- func (state *QuestionState) NoAskCaptureQuestion(answer **waProto.Message) *QuestionState
- func (state *QuestionState) SetNoAskQuestions(answer any) *QuestionState
- func (state *QuestionState) SetNoAskReplyQuestion(answer any) *QuestionState
- func (state *QuestionState) SetParserSeparator(separator string) *QuestionState
- func (state *QuestionState) SetQuestion(question string, answer any) *QuestionState
- func (state *QuestionState) SetReplyQuestion(question string, answer any) *QuestionState
- func (state *QuestionState) WithEmoji(emoji string) *QuestionState
- func (state *QuestionState) WithLikeEmoji() *QuestionState
- func (state *QuestionState) WithOkEmoji() *QuestionState
- func (state *QuestionState) WithTimeEmoji() *QuestionState
- type Questions
- type RunFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReleaseCtx ¶
func ReleaseCtx(c *Ctx)
Types ¶
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func AcquireCtx ¶
func AcquireCtx() *Ctx
func (*Ctx) AddMemberToGroup ¶
AddMemberToGroup add members from group
func (*Ctx) ByteToMessage ¶
ByteToMessage convert byte to whatsmeow message object
func (*Ctx) DemoteMemberInGroup ¶
DemoteMemberInGroup kick a member from group
func (*Ctx) DownloadMessage ¶
DownloadMessage download with given message
func (*Ctx) DownloadMessageToFile ¶
func (context *Ctx) DownloadMessageToFile(message *waProto.Message, quoted bool, fileName string) (*os.File, error)
DownloadMessageToFile download with given message to file
func (*Ctx) DownloadToFile ¶
DownloadToFile download message to file with quoted message
func (*Ctx) EditMessageText ¶
EditMessageText edit current text message to given text
func (*Ctx) FindGroupByJid ¶
FindGroupByJid find group by jid from cache
func (*Ctx) FindMessageByID ¶
FindMessageByID find message by specific id from local store
func (*Ctx) GenerateReplyMessage ¶
GenerateReplyMessage generate reply message to whatsmeow message object
func (*Ctx) GetAllChats ¶
GetAllChats get all chats from local store
func (*Ctx) GetAllGroups ¶
GetAllGroups get all groups from cache
func (*Ctx) GetChatInJID ¶
GetChatInJID get chats in jid from local store
func (*Ctx) GetDownloadable ¶
GetDownloadable get downloadable type
func (*Ctx) GetDownloadableMessage ¶
GetDownloadableMessage get downloadable with given message
func (*Ctx) GetGroupInfo ¶
GetGroupInfo get group info from cache
func (*Ctx) GetGroupInfoFromInviteLink ¶
GetGroupInfoFromInviteLink get group info from invite link
func (*Ctx) GetGroupInviteLink ¶
GetGroupInviteLink get current group invite link
func (*Ctx) GetGroupProfilePicture ¶
GetGroupProfilePicture get group profile picture
func (*Ctx) GetJoinedGroups ¶
GetJoinedGroups get client joined group from cache
func (*Ctx) GetStatusMessages ¶
GetStatusMessages get client statuses from local store
func (*Ctx) GetUserInfo ¶
GetUserInfo get contact user info from cache
func (*Ctx) IsClientGroupAdmin ¶
IsClientGroupAdmin check if client is a group admin
func (*Ctx) IsGroupAdmin ¶
IsGroupAdmin check is target jid are group admin
func (*Ctx) JoinGroupInviteLink ¶
JoinGroupInviteLink join a group invite link
func (*Ctx) LeaveFromGroup ¶
LeaveFromGroup leave group from given jid
func (*Ctx) LeaveFromThisGroup ¶
LeaveFromThisGroup leave from this group chat
func (*Ctx) MessageEvent ¶
func (*Ctx) MessageInfo ¶
func (context *Ctx) MessageInfo() waTypes.MessageInfo
func (*Ctx) Methods ¶
func (context *Ctx) Methods() types.ClientMethods
func (*Ctx) NewPollingState ¶
func (context *Ctx) NewPollingState() *PollingState
func (*Ctx) NewUserQuestion ¶
func (context *Ctx) NewUserQuestion() *QuestionState
NewUserQuestion New user question engine
func (*Ctx) PromoteMemberInGroup ¶
PromoteMemberInGroup kick a member from group
func (*Ctx) RemoveMemberFromGroup ¶
RemoveMemberFromGroup kick members from group
func (*Ctx) RevokeGroupInvite ¶
RevokeGroupInvite revoke current group invite link
func (*Ctx) RevokeMessage ¶
RevokeMessage revoke message from given jid and client message id
func (*Ctx) SendMessage ¶
func (*Ctx) SendReadPresence ¶
func (context *Ctx) SendReadPresence()
SendReadPresence send read status in current chat
func (*Ctx) SendReplyMessage ¶
SendReplyMessage send reply message in current chat
func (*Ctx) SendTypingPresence ¶
SendTypingPresence send typing action in current chat
func (*Ctx) SetClientJID ¶
func (*Ctx) SetClientMethods ¶
func (context *Ctx) SetClientMethods(clientMethods types.ClientMethods)
func (*Ctx) SetGroupAnnounce ¶
SetGroupAnnounce set group announce info
func (*Ctx) SetGroupLocked ¶
SetGroupLocked set current group to locked
func (*Ctx) SetGroupName ¶
SetGroupName set current group name
func (*Ctx) SetGroupPhoto ¶
SetGroupPhoto set current group photo
func (*Ctx) SetLocalsWithTTL ¶
func (*Ctx) SetMessageEvent ¶
func (*Ctx) SetOptions ¶
func (*Ctx) SetParsedMsg ¶
func (*Ctx) SetPollingChan ¶
func (context *Ctx) SetPollingChan(pooling chan *PollingState)
func (*Ctx) SetQuestionChan ¶
func (context *Ctx) SetQuestionChan(question chan *QuestionState)
func (*Ctx) SetUserStatus ¶
SetUserStatus set client status
func (*Ctx) UpdateClientProfilePicture ¶
UpdateClientProfilePicture update client profile picture
func (*Ctx) UpdateGroupProfilePicture ¶
UpdateGroupProfilePicture update group profile picture
func (*Ctx) UploadAudioFromUrl ¶
func (context *Ctx) UploadAudioFromUrl(url string) (*waProto.AudioMessage, error)
UploadAudioFromUrl upload audio from given url
func (*Ctx) UploadAudioMessageFromBytes ¶
func (context *Ctx) UploadAudioMessageFromBytes(bytes []byte) (*waProto.AudioMessage, error)
UploadAudioMessageFromBytes upload audio from given bytes
func (*Ctx) UploadAudioMessageFromPath ¶
func (context *Ctx) UploadAudioMessageFromPath(path string) (*waProto.AudioMessage, error)
UploadAudioMessageFromPath upload audio message from given path
func (*Ctx) UploadBytesMedia ¶
UploadBytesMedia upload bytes media based from mimetype
func (*Ctx) UploadDocumentFromUrl ¶
func (context *Ctx) UploadDocumentFromUrl(url, title, filename string) (*waProto.DocumentMessage, error)
UploadDocumentFromUrl upload document from given url
func (*Ctx) UploadDocumentMessageFromBytes ¶
func (context *Ctx) UploadDocumentMessageFromBytes(bytes []byte, title, filename string) (*waProto.DocumentMessage, error)
UploadDocumentMessageFromBytes upload document from given bytes
func (*Ctx) UploadDocumentMessageFromPath ¶
func (context *Ctx) UploadDocumentMessageFromPath(path, title string) (*waProto.DocumentMessage, error)
UploadDocumentMessageFromPath upload document from given path
func (*Ctx) UploadImageFromUrl ¶
func (context *Ctx) UploadImageFromUrl(url, caption string) (*waProto.ImageMessage, error)
UploadImageFromUrl upload image from given url
func (*Ctx) UploadImageMessageFromBytes ¶
func (context *Ctx) UploadImageMessageFromBytes(bytes []byte, caption string) (*waProto.ImageMessage, error)
UploadImageMessageFromBytes upload image from given bytes
func (*Ctx) UploadImageMessageFromPath ¶
func (context *Ctx) UploadImageMessageFromPath(path, caption string) (*waProto.ImageMessage, error)
UploadImageMessageFromPath upload a image from given path
func (*Ctx) UploadMediaFromUrl ¶
UploadMediaFromUrl upload media detected from mimetype
func (*Ctx) UploadStickerFromUrl ¶
func (context *Ctx) UploadStickerFromUrl(url string) (*waProto.StickerMessage, error)
UploadStickerFromUrl upload sticker from given url
func (*Ctx) UploadStickerMessageFromBytes ¶
func (context *Ctx) UploadStickerMessageFromBytes(bytes []byte) (*waProto.StickerMessage, error)
UploadStickerMessageFromBytes upload sticker from given bytes
func (*Ctx) UploadStickerMessageFromPath ¶
func (context *Ctx) UploadStickerMessageFromPath(path string) (*waProto.StickerMessage, error)
UploadStickerMessageFromPath upload sticker from given path
func (*Ctx) UploadVideoFromUrl ¶
func (context *Ctx) UploadVideoFromUrl(url, caption string) (*waProto.VideoMessage, error)
UploadVideoFromUrl upload video from given url
func (*Ctx) UploadVideoMessageFromBytes ¶
func (context *Ctx) UploadVideoMessageFromBytes(bytes []byte, caption string) (*waProto.VideoMessage, error)
UploadVideoMessageFromBytes upload video from given bytes
func (*Ctx) UploadVideoMessageFromPath ¶
func (context *Ctx) UploadVideoMessageFromPath(path, caption string) (*waProto.VideoMessage, error)
UploadVideoMessageFromPath upload video from given path
type MiddlewareFunc ¶
type PollingOptions ¶
type PollingState ¶
type PollingState struct { PollId string PollName string PollOptions []PollingOptions PollSelectable int PollingTimeout *time.Duration Ctx *Ctx PollWithRevoke bool PollingResult []string ResultChan chan bool }
func NewPollingState ¶
func NewPollingState(context *Ctx) *PollingState
func (*PollingState) Exec ¶
func (p *PollingState) Exec() []string
func (*PollingState) SetOnlyOnePool ¶
func (p *PollingState) SetOnlyOnePool() *PollingState
func (*PollingState) SetPollInformation ¶
func (p *PollingState) SetPollInformation(name string, options []string) *PollingState
func (*PollingState) SetSelectableOption ¶
func (p *PollingState) SetSelectableOption(count int) *PollingState
func (*PollingState) SetTimeBasedType ¶
func (p *PollingState) SetTimeBasedType(timeOut time.Duration) *PollingState
func (*PollingState) WithRevoke ¶
func (p *PollingState) WithRevoke() *PollingState
type QuestionState ¶
type QuestionState struct { WithEmojiReact bool EmojiReact string Separator string Ctx *Ctx ActiveQuestion string Questions []*Questions ResultChan chan bool }
func NewUserQuestion ¶
func NewUserQuestion(context *Ctx) *QuestionState
NewUserQuestion New user question engine
func (*QuestionState) CaptureMediaQuestion ¶
func (state *QuestionState) CaptureMediaQuestion(question string, answer **waProto.Message) *QuestionState
CaptureMediaQuestion Set a question to capture media object
func (*QuestionState) CaptureQuestion ¶
func (state *QuestionState) CaptureQuestion(question string, answer **waProto.Message) *QuestionState
CaptureQuestion Set a question to capture message object with json string format
func (*QuestionState) Exec ¶
func (state *QuestionState) Exec()
Exec Run question engine without argument parser
func (*QuestionState) ExecWithParser ¶
func (state *QuestionState) ExecWithParser()
ExecWithParser Run question engine with argument parser
func (*QuestionState) NoAskCaptureMediaQuestion ¶
func (state *QuestionState) NoAskCaptureMediaQuestion(answer **waProto.Message) *QuestionState
NoAskCaptureMediaQuestion Set no asking question to capture media object
func (*QuestionState) NoAskCaptureQuestion ¶
func (state *QuestionState) NoAskCaptureQuestion(answer **waProto.Message) *QuestionState
NoAskCaptureQuestion Set no asking question to capture message object with json string format
func (*QuestionState) SetNoAskQuestions ¶
func (state *QuestionState) SetNoAskQuestions(answer any) *QuestionState
SetNoAskQuestions Set no asking question based on question and string answer pointer
func (*QuestionState) SetNoAskReplyQuestion ¶
func (state *QuestionState) SetNoAskReplyQuestion(answer any) *QuestionState
SetNoAskReplyQuestion Set no asking question based on message has a reply string answer pointer
func (*QuestionState) SetParserSeparator ¶
func (state *QuestionState) SetParserSeparator(separator string) *QuestionState
SetParserSeparator Set parser separator for question, eg: /hello world | info [" | " is the separator]
func (*QuestionState) SetQuestion ¶
func (state *QuestionState) SetQuestion(question string, answer any) *QuestionState
SetQuestion Set a question based on question and string answer pointer
func (*QuestionState) SetReplyQuestion ¶
func (state *QuestionState) SetReplyQuestion(question string, answer any) *QuestionState
SetReplyQuestion Set a question based on message has a reply string answer pointer
func (*QuestionState) WithEmoji ¶
func (state *QuestionState) WithEmoji(emoji string) *QuestionState
WithEmoji react custom emoji when user answered a question
func (*QuestionState) WithLikeEmoji ¶
func (state *QuestionState) WithLikeEmoji() *QuestionState
WithLikeEmoji react 👍 when user answered a question
func (*QuestionState) WithOkEmoji ¶
func (state *QuestionState) WithOkEmoji() *QuestionState
WithOkEmoji react 👌 when user answered a question
func (*QuestionState) WithTimeEmoji ¶
func (state *QuestionState) WithTimeEmoji() *QuestionState
WithTimeEmoji react ⏳ when user answered a question