feat: add download commands (yt, ig, tt, fb) and middleware support
- Add core Middleware support via `core.Default.Use()` - Implement download command handlers for YouTube, Instagram, TikTok, and Facebook - Add regex-based URL validation for all download commands - Add API client for fetching download links - Add helpers for uploading and sending media to WhatsApp Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
@@ -66,6 +66,29 @@ func WithReply(evt *events.Message) *waE2E.ContextInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// GetQuotedStanzaID returns the stanza ID of the message being replied to, if any.
|
||||
func GetQuotedStanzaID(m *waE2E.Message) string {
|
||||
if m == nil {
|
||||
return ""
|
||||
}
|
||||
switch {
|
||||
case m.GetExtendedTextMessage().GetContextInfo() != nil:
|
||||
return m.GetExtendedTextMessage().GetContextInfo().GetStanzaID()
|
||||
case m.GetImageMessage().GetContextInfo() != nil:
|
||||
return m.GetImageMessage().GetContextInfo().GetStanzaID()
|
||||
case m.GetVideoMessage().GetContextInfo() != nil:
|
||||
return m.GetVideoMessage().GetContextInfo().GetStanzaID()
|
||||
case m.GetDocumentMessage().GetContextInfo() != nil:
|
||||
return m.GetDocumentMessage().GetContextInfo().GetStanzaID()
|
||||
case m.GetAudioMessage().GetContextInfo() != nil:
|
||||
return m.GetAudioMessage().GetContextInfo().GetStanzaID()
|
||||
case m.GetStickerMessage().GetContextInfo() != nil:
|
||||
return m.GetStickerMessage().GetContextInfo().GetStanzaID()
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
// ParseJID parses a JID string, adding @s.whatsapp.net if no server is specified.
|
||||
func ParseJID(arg string) (waTypes.JID, bool) {
|
||||
if arg == "" {
|
||||
|
||||
Reference in New Issue
Block a user