Documentation
¶
Index ¶
- type Command
- type MiddlewareFunc
- 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
- type RunFuncContext
- func (runFunc *RunFuncContext) ByteToMessage(value []byte, withReply bool, caption string) *waProto.Message
- func (runFunc *RunFuncContext) DelLocals(key string)
- func (runFunc *RunFuncContext) Download(quoted bool) ([]byte, error)
- func (runFunc *RunFuncContext) DownloadMessage(message *waProto.Message, quoted bool) ([]byte, error)
- func (runFunc *RunFuncContext) DownloadMessageToFile(message *waProto.Message, quoted bool, fileName string) (*os.File, error)
- func (runFunc *RunFuncContext) DownloadToFile(quoted bool, fileName string) (*os.File, error)
- func (runFunc *RunFuncContext) EditMessageText(to string) error
- func (runFunc *RunFuncContext) FindGroupByJid(groupJid waTypes.JID) (group *waTypes.GroupInfo, err error)
- func (runFunc *RunFuncContext) FindMessageByID(jid waTypes.JID, id string) *events.Message
- func (runFunc *RunFuncContext) GenerateReplyMessage(obj any) *waProto.Message
- func (runFunc *RunFuncContext) GetAllChats() []*events.Message
- func (runFunc *RunFuncContext) GetAllGroups() (group []*waTypes.GroupInfo, err error)
- func (runFunc *RunFuncContext) GetChatInJID(jid waTypes.JID) []*events.Message
- func (runFunc *RunFuncContext) GetClient() *whatsmeow.Client
- func (runFunc *RunFuncContext) GetClientJID() *waTypes.JID
- func (runFunc *RunFuncContext) GetCommand() *Command
- func (runFunc *RunFuncContext) GetDownloadable(quoted bool) *waProto.Message
- func (runFunc *RunFuncContext) GetDownloadableMessage(message *waProto.Message, quoted bool) *waProto.Message
- func (runFunc *RunFuncContext) GetGroupInfo(jid any) (*waTypes.GroupInfo, error)
- func (runFunc *RunFuncContext) GetGroupInfoFromInviteLink(link string) (*waTypes.GroupInfo, error)
- func (runFunc *RunFuncContext) GetGroupInviteLink(jid any, reset bool) (string, error)
- func (runFunc *RunFuncContext) GetJoinedGroups() ([]*waTypes.GroupInfo, error)
- func (runFunc *RunFuncContext) GetLocals(key string) (string, bool)
- func (runFunc *RunFuncContext) GetMessage() *waProto.Message
- func (runFunc *RunFuncContext) GetMessageEvent() *events.Message
- func (runFunc *RunFuncContext) GetMessageInfo() *waTypes.MessageInfo
- func (runFunc *RunFuncContext) GetOptions() *options.Options
- func (runFunc *RunFuncContext) GetProfilePicture(jid any) (string, error)
- func (runFunc *RunFuncContext) GetStatusMessages() []*events.Message
- func (runFunc *RunFuncContext) GetUser(jid any) (result waTypes.UserInfo, err error)
- func (runFunc *RunFuncContext) IsClientGroupAdmin() (bool, error)
- func (runFunc *RunFuncContext) IsGroupAdmin(jid any) (bool, error)
- func (runFunc *RunFuncContext) JoinInviteLink(link string) error
- func (runFunc *RunFuncContext) RangeLocals(fun func(key string, value string) bool)
- func (runFunc *RunFuncContext) RevokeMessage(jid waTypes.JID, messageId waTypes.MessageID)
- func (runFunc *RunFuncContext) SendEmoji(emoji string)
- func (runFunc *RunFuncContext) SendMessage(obj any)
- func (runFunc *RunFuncContext) SendReadPresence()
- func (runFunc *RunFuncContext) SendReplyMessage(obj any)
- func (runFunc *RunFuncContext) SendTypingPresence(duration time.Duration)
- func (runFunc *RunFuncContext) SetGroupAnnounce(announce bool) error
- func (runFunc *RunFuncContext) SetGroupLocked(locked bool) error
- func (runFunc *RunFuncContext) SetGroupName(name string) error
- func (runFunc *RunFuncContext) SetGroupPhoto(data []byte) error
- func (runFunc *RunFuncContext) SetLocals(key string, value string)
- func (runFunc *RunFuncContext) SetLocalsWithTTL(key string, value string, ttl time.Duration)
- func (runFunc *RunFuncContext) SetUserStatus(status string) error
- func (runFunc *RunFuncContext) UpdateClientProfilePicture(data []byte) error
- func (runFunc *RunFuncContext) UpdateProfilePicture(jid any, data []byte) error
- func (runFunc *RunFuncContext) UploadAudioFromUrl(url string) (*waProto.AudioMessage, error)
- func (runFunc *RunFuncContext) UploadAudioMessageFromBytes(bytes []byte) (*waProto.AudioMessage, error)
- func (runFunc *RunFuncContext) UploadAudioMessageFromPath(path string) (*waProto.AudioMessage, error)
- func (runFunc *RunFuncContext) UploadDocumentFromUrl(url, title, filename string) (*waProto.DocumentMessage, error)
- func (runFunc *RunFuncContext) UploadDocumentMessageFromBytes(bytes []byte, title, filename string) (*waProto.DocumentMessage, error)
- func (runFunc *RunFuncContext) UploadDocumentMessageFromPath(path, title string) (*waProto.DocumentMessage, error)
- func (runFunc *RunFuncContext) UploadImageFromUrl(url, caption string) (*waProto.ImageMessage, error)
- func (runFunc *RunFuncContext) UploadImageMessageFromBytes(bytes []byte, caption string) (*waProto.ImageMessage, error)
- func (runFunc *RunFuncContext) UploadImageMessageFromPath(path, caption string) (*waProto.ImageMessage, error)
- func (runFunc *RunFuncContext) UploadStickerFromUrl(url string) (*waProto.StickerMessage, error)
- func (runFunc *RunFuncContext) UploadStickerMessageFromBytes(bytes []byte) (*waProto.StickerMessage, error)
- func (runFunc *RunFuncContext) UploadStickerMessageFromPath(path string) (*waProto.StickerMessage, error)
- func (runFunc *RunFuncContext) UploadVideoFromUrl(url, caption string) (*waProto.VideoMessage, error)
- func (runFunc *RunFuncContext) UploadVideoMessageFromBytes(bytes []byte, caption string) (*waProto.VideoMessage, error)
- func (runFunc *RunFuncContext) UploadVideoMessageFromPath(path, caption string) (*waProto.VideoMessage, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(c *RunFuncContext) bool
type QuestionState ¶
type QuestionState struct { WithEmojiReact bool EmojiReact string Separator string RunFuncCtx *RunFuncContext ActiveQuestion string Questions []*Questions ResultChan chan bool }
func NewUserQuestion ¶
func NewUserQuestion(ctx *RunFuncContext) *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
type Questions ¶
type RunFunc ¶
type RunFunc func(c *RunFuncContext) *waProto.Message
type RunFuncContext ¶
type RunFuncContext struct { FromMe bool ParsedMsg string Number string Prefix string Arguments []string CurrentCommand *Command WaLog waLog.Logger ClientJID *waTypes.JID MessageEvent *events.Message Options *options.Options Message *waProto.Message Client *whatsmeow.Client QuestionChan chan *QuestionState MessageInfo *waTypes.MessageInfo Locals *skipmap.StringMap[string] Ctx *skipmap.StringMap[types.RoxyContext] }
func (*RunFuncContext) ByteToMessage ¶
func (*RunFuncContext) DelLocals ¶
func (runFunc *RunFuncContext) DelLocals(key string)
func (*RunFuncContext) Download ¶
func (runFunc *RunFuncContext) Download(quoted bool) ([]byte, error)
Download message with get quoted message
func (*RunFuncContext) DownloadMessage ¶
func (runFunc *RunFuncContext) DownloadMessage(message *waProto.Message, quoted bool) ([]byte, error)
DownloadMessage download with given message
func (*RunFuncContext) DownloadMessageToFile ¶
func (runFunc *RunFuncContext) DownloadMessageToFile(message *waProto.Message, quoted bool, fileName string) (*os.File, error)
DownloadMessageToFile download with given message to file
func (*RunFuncContext) DownloadToFile ¶
DownloadToFile download message to file with quoted message
func (*RunFuncContext) EditMessageText ¶
func (runFunc *RunFuncContext) EditMessageText(to string) error
func (*RunFuncContext) FindGroupByJid ¶
func (*RunFuncContext) FindMessageByID ¶
func (*RunFuncContext) GenerateReplyMessage ¶
func (runFunc *RunFuncContext) GenerateReplyMessage(obj any) *waProto.Message
func (*RunFuncContext) GetAllChats ¶
func (runFunc *RunFuncContext) GetAllChats() []*events.Message
func (*RunFuncContext) GetAllGroups ¶
func (runFunc *RunFuncContext) GetAllGroups() (group []*waTypes.GroupInfo, err error)
func (*RunFuncContext) GetChatInJID ¶
func (runFunc *RunFuncContext) GetChatInJID(jid waTypes.JID) []*events.Message
func (*RunFuncContext) GetClient ¶
func (runFunc *RunFuncContext) GetClient() *whatsmeow.Client
func (*RunFuncContext) GetClientJID ¶
func (runFunc *RunFuncContext) GetClientJID() *waTypes.JID
func (*RunFuncContext) GetCommand ¶
func (runFunc *RunFuncContext) GetCommand() *Command
func (*RunFuncContext) GetDownloadable ¶
func (runFunc *RunFuncContext) GetDownloadable(quoted bool) *waProto.Message
GetDownloadable get downloadable type
func (*RunFuncContext) GetDownloadableMessage ¶
func (runFunc *RunFuncContext) GetDownloadableMessage(message *waProto.Message, quoted bool) *waProto.Message
GetDownloadableMessage get downloadable with given message
func (*RunFuncContext) GetGroupInfo ¶
func (runFunc *RunFuncContext) GetGroupInfo(jid any) (*waTypes.GroupInfo, error)
func (*RunFuncContext) GetGroupInfoFromInviteLink ¶
func (runFunc *RunFuncContext) GetGroupInfoFromInviteLink(link string) (*waTypes.GroupInfo, error)
func (*RunFuncContext) GetGroupInviteLink ¶
func (runFunc *RunFuncContext) GetGroupInviteLink(jid any, reset bool) (string, error)
func (*RunFuncContext) GetJoinedGroups ¶
func (runFunc *RunFuncContext) GetJoinedGroups() ([]*waTypes.GroupInfo, error)
func (*RunFuncContext) GetLocals ¶
func (runFunc *RunFuncContext) GetLocals(key string) (string, bool)
func (*RunFuncContext) GetMessage ¶
func (runFunc *RunFuncContext) GetMessage() *waProto.Message
func (*RunFuncContext) GetMessageEvent ¶
func (runFunc *RunFuncContext) GetMessageEvent() *events.Message
func (*RunFuncContext) GetMessageInfo ¶
func (runFunc *RunFuncContext) GetMessageInfo() *waTypes.MessageInfo
func (*RunFuncContext) GetOptions ¶
func (runFunc *RunFuncContext) GetOptions() *options.Options
func (*RunFuncContext) GetProfilePicture ¶
func (runFunc *RunFuncContext) GetProfilePicture(jid any) (string, error)
func (*RunFuncContext) GetStatusMessages ¶
func (runFunc *RunFuncContext) GetStatusMessages() []*events.Message
func (*RunFuncContext) GetUser ¶
func (runFunc *RunFuncContext) GetUser(jid any) (result waTypes.UserInfo, err error)
func (*RunFuncContext) IsClientGroupAdmin ¶
func (runFunc *RunFuncContext) IsClientGroupAdmin() (bool, error)
func (*RunFuncContext) IsGroupAdmin ¶
func (runFunc *RunFuncContext) IsGroupAdmin(jid any) (bool, error)
func (*RunFuncContext) JoinInviteLink ¶
func (runFunc *RunFuncContext) JoinInviteLink(link string) error
func (*RunFuncContext) RangeLocals ¶
func (runFunc *RunFuncContext) RangeLocals(fun func(key string, value string) bool)
func (*RunFuncContext) RevokeMessage ¶
func (runFunc *RunFuncContext) RevokeMessage(jid waTypes.JID, messageId waTypes.MessageID)
func (*RunFuncContext) SendEmoji ¶
func (runFunc *RunFuncContext) SendEmoji(emoji string)
func (*RunFuncContext) SendMessage ¶
func (runFunc *RunFuncContext) SendMessage(obj any)
func (*RunFuncContext) SendReadPresence ¶
func (runFunc *RunFuncContext) SendReadPresence()
func (*RunFuncContext) SendReplyMessage ¶
func (runFunc *RunFuncContext) SendReplyMessage(obj any)
func (*RunFuncContext) SendTypingPresence ¶
func (runFunc *RunFuncContext) SendTypingPresence(duration time.Duration)
func (*RunFuncContext) SetGroupAnnounce ¶
func (runFunc *RunFuncContext) SetGroupAnnounce(announce bool) error
func (*RunFuncContext) SetGroupLocked ¶
func (runFunc *RunFuncContext) SetGroupLocked(locked bool) error
func (*RunFuncContext) SetGroupName ¶
func (runFunc *RunFuncContext) SetGroupName(name string) error
func (*RunFuncContext) SetGroupPhoto ¶
func (runFunc *RunFuncContext) SetGroupPhoto(data []byte) error
func (*RunFuncContext) SetLocals ¶
func (runFunc *RunFuncContext) SetLocals(key string, value string)
func (*RunFuncContext) SetLocalsWithTTL ¶
func (runFunc *RunFuncContext) SetLocalsWithTTL(key string, value string, ttl time.Duration)
func (*RunFuncContext) SetUserStatus ¶
func (runFunc *RunFuncContext) SetUserStatus(status string) error
func (*RunFuncContext) UpdateClientProfilePicture ¶
func (runFunc *RunFuncContext) UpdateClientProfilePicture(data []byte) error
func (*RunFuncContext) UpdateProfilePicture ¶
func (runFunc *RunFuncContext) UpdateProfilePicture(jid any, data []byte) error
func (*RunFuncContext) UploadAudioFromUrl ¶
func (runFunc *RunFuncContext) UploadAudioFromUrl(url string) (*waProto.AudioMessage, error)
func (*RunFuncContext) UploadAudioMessageFromBytes ¶
func (runFunc *RunFuncContext) UploadAudioMessageFromBytes(bytes []byte) (*waProto.AudioMessage, error)
func (*RunFuncContext) UploadAudioMessageFromPath ¶
func (runFunc *RunFuncContext) UploadAudioMessageFromPath(path string) (*waProto.AudioMessage, error)
func (*RunFuncContext) UploadDocumentFromUrl ¶
func (runFunc *RunFuncContext) UploadDocumentFromUrl(url, title, filename string) (*waProto.DocumentMessage, error)
func (*RunFuncContext) UploadDocumentMessageFromBytes ¶
func (runFunc *RunFuncContext) UploadDocumentMessageFromBytes(bytes []byte, title, filename string) (*waProto.DocumentMessage, error)
func (*RunFuncContext) UploadDocumentMessageFromPath ¶
func (runFunc *RunFuncContext) UploadDocumentMessageFromPath(path, title string) (*waProto.DocumentMessage, error)
func (*RunFuncContext) UploadImageFromUrl ¶
func (runFunc *RunFuncContext) UploadImageFromUrl(url, caption string) (*waProto.ImageMessage, error)
func (*RunFuncContext) UploadImageMessageFromBytes ¶
func (runFunc *RunFuncContext) UploadImageMessageFromBytes(bytes []byte, caption string) (*waProto.ImageMessage, error)
func (*RunFuncContext) UploadImageMessageFromPath ¶
func (runFunc *RunFuncContext) UploadImageMessageFromPath(path, caption string) (*waProto.ImageMessage, error)
func (*RunFuncContext) UploadStickerFromUrl ¶
func (runFunc *RunFuncContext) UploadStickerFromUrl(url string) (*waProto.StickerMessage, error)
func (*RunFuncContext) UploadStickerMessageFromBytes ¶
func (runFunc *RunFuncContext) UploadStickerMessageFromBytes(bytes []byte) (*waProto.StickerMessage, error)
func (*RunFuncContext) UploadStickerMessageFromPath ¶
func (runFunc *RunFuncContext) UploadStickerMessageFromPath(path string) (*waProto.StickerMessage, error)
func (*RunFuncContext) UploadVideoFromUrl ¶
func (runFunc *RunFuncContext) UploadVideoFromUrl(url, caption string) (*waProto.VideoMessage, error)
func (*RunFuncContext) UploadVideoMessageFromBytes ¶
func (runFunc *RunFuncContext) UploadVideoMessageFromBytes(bytes []byte, caption string) (*waProto.VideoMessage, error)
func (*RunFuncContext) UploadVideoMessageFromPath ¶
func (runFunc *RunFuncContext) UploadVideoMessageFromPath(path, caption string) (*waProto.VideoMessage, error)