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:
Fd
2026-07-15 10:33:58 +07:00
co-authored by Claude Opus 4.7
parent faeda0b21d
commit e783284881
11 changed files with 701 additions and 7 deletions
+23
View File
@@ -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 == "" {