util

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2023 License: GPL-3.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListPrefixes = []string{"!", "/", "#", "?", ".", "@", "&", "*", "-", "=", "+"}

Functions

func CreateUid

func CreateUid() string

func DoHTTPRequest

func DoHTTPRequest(method string, url string) ([]byte, error)

func GetQuotedText

func GetQuotedText(m *events.Message) string

func IsValidUrl

func IsValidUrl(s string) bool

func JIDToString

func JIDToString(jidStr any) (result string, err error)

func ParseAllJid

func ParseAllJid(jid any) (pJid waTypes.JID, err error)

func ParseArgs

func ParseArgs(str string) []string

func ParseCmd

func ParseCmd(str string) (prefix string, cmd string, ok bool)

func ParseGroupJid

func ParseGroupJid(jid any) (pJid waTypes.JID, err error)

func ParseJID

func ParseJID(arg string) (waTypes.JID, bool)

func ParseMentionedJid

func ParseMentionedJid(m *waProto.Message) []string

func ParseMessageText

func ParseMessageText(m *events.Message) string

func ParseQuotedBy

func ParseQuotedBy(m *waProto.Message, str string) *waProto.Message

func ParseQuotedMessage

func ParseQuotedMessage(m *waProto.Message) *waProto.Message

func ParseQuotedMessageId

func ParseQuotedMessageId(m *waProto.Message) *string

func ParseQuotedRemoteJid

func ParseQuotedRemoteJid(m *waProto.Message) *string

func ParseUserJid

func ParseUserJid(jid any) (pJid waTypes.JID, err error)

func RemoveDuplicate added in v1.2.0

func RemoveDuplicate[T string | int](sliceList []T) []T

func RemoveElementByIndex

func RemoveElementByIndex[T []any](slice []T, index int) []T

func StringIsOnSlice

func StringIsOnSlice(target string, slice []string) bool

func WithReply

func WithReply(m *events.Message) *waProto.ContextInfo

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL