Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Owner_Number=6289636559820@s.whatsapp.net
Owner_Number=6285142003110@s.whatsapp.net
Name_Bot=Mao Bot
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.db
logs.txt
go.sum
.sesi
.sesi
.env
38 changes: 19 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
module mao

go 1.20
go 1.24

require (
github.com/Pauloo27/searchtube v0.0.0-20220521202404-f65e288832a0
github.com/google/uuid v1.5.0
github.com/mattn/go-sqlite3 v1.14.19
github.com/google/uuid v1.6.0
github.com/mattn/go-sqlite3 v1.14.27
github.com/mdp/qrterminal v1.0.1
github.com/nyaruka/phonenumbers v1.3.0
github.com/robertkrimen/otto v0.3.0
github.com/nyaruka/phonenumbers v1.6.0
github.com/robertkrimen/otto v0.5.1
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
github.com/subosito/gotenv v1.6.0
go.mau.fi/util v0.2.1
go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735
google.golang.org/protobuf v1.31.0
go.mau.fi/util v0.8.6
go.mau.fi/whatsmeow v0.0.0-20250411192951-5ab78fadbf91
google.golang.org/protobuf v1.36.6
)

require (
filippo.io/edwards25519 v1.1.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/klauspost/compress v1.10.4 // indirect
github.com/lithdew/bytesutil v0.0.0-20200409052507-d98389230a59 // indirect
github.com/lithdew/nicehttp v0.0.0-20200422123956-0d3d3dd9b482 // indirect
go.mau.fi/libsignal v0.1.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.16.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/petermattis/goid v0.0.0-20250319124200-ccd6737f222a // indirect
github.com/rs/zerolog v1.34.0 // indirect
go.mau.fi/libsignal v0.1.2 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.24.0 // indirect
gopkg.in/sourcemap.v1 v1.0.5 // indirect
rsc.io/qr v0.2.0 // indirect
)
4 changes: 2 additions & 2 deletions src/commands/group-change.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ func init() {
var ok error
// apalah ini gw bingung
if m.QuotedMsg != nil {
if m.QuotedMsg.MentionedJid != nil {
ajid := m.QuotedMsg.MentionedJid
if m.QuotedMsg.MentionedJID != nil {
ajid := m.QuotedMsg.MentionedJID
ujid = make([]types.JID, len(ajid))
for i, a := range ajid {
ujid[i], ok = types.ParseJID(a)
Expand Down
41 changes: 21 additions & 20 deletions src/libs/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (

"go.mau.fi/util/random"
"go.mau.fi/whatsmeow"
waProto "go.mau.fi/whatsmeow/binary/proto"
"go.mau.fi/whatsmeow/proto/waCommon"
waProto "go.mau.fi/whatsmeow/proto/waE2E"
"go.mau.fi/whatsmeow/types"
"google.golang.org/protobuf/proto"
)
Expand All @@ -43,15 +44,15 @@ func (client *NewClientImpl) SendText(from types.JID, txt string, opts *waProto.

func (client *NewClientImpl) SendWithNewsLestter(from types.JID, text string, newjid string, newserver int32, name string, opts *waProto.ContextInfo) (whatsmeow.SendResponse, error) {
ok, er := client.SendText(from, text, &waProto.ContextInfo{
ForwardedNewsletterMessageInfo: &waProto.ForwardedNewsletterMessageInfo{
NewsletterJid: proto.String(newjid),
ForwardedNewsletterMessageInfo: &waProto.ContextInfo_ForwardedNewsletterMessageInfo{
NewsletterJID: proto.String(newjid),
NewsletterName: proto.String(name),
ServerMessageId: proto.Int32(newserver),
ContentType: waProto.ForwardedNewsletterMessageInfo_UPDATE.Enum(),
ServerMessageID: proto.Int32(newserver),
ContentType: waProto.ContextInfo_ForwardedNewsletterMessageInfo_UPDATE.Enum(),
AccessibilityText: proto.String(""),
},
IsForwarded: proto.Bool(true),
StanzaId: opts.StanzaId,
StanzaID: opts.StanzaID,
Participant: opts.Participant,
QuotedMessage: opts.QuotedMessage,
})
Expand All @@ -70,13 +71,13 @@ func (client *NewClientImpl) SendImage(from types.JID, data []byte, caption stri
}
resultImg := &waProto.Message{
ImageMessage: &waProto.ImageMessage{
Url: proto.String(uploaded.URL),
URL: proto.String(uploaded.URL),
DirectPath: proto.String(uploaded.DirectPath),
MediaKey: uploaded.MediaKey,
Caption: proto.String(caption),
Mimetype: proto.String(http.DetectContentType(data)),
FileEncSha256: uploaded.FileEncSHA256,
FileSha256: uploaded.FileSHA256,
FileEncSHA256: uploaded.FileEncSHA256,
FileSHA256: uploaded.FileSHA256,
FileLength: proto.Uint64(uint64(len(data))),
ContextInfo: opts,
},
Expand All @@ -93,13 +94,13 @@ func (client *NewClientImpl) SendVideo(from types.JID, data []byte, caption stri
}
resultVideo := &waProto.Message{
VideoMessage: &waProto.VideoMessage{
Url: proto.String(uploaded.URL),
URL: proto.String(uploaded.URL),
DirectPath: proto.String(uploaded.DirectPath),
MediaKey: uploaded.MediaKey,
Caption: proto.String(caption),
Mimetype: proto.String(http.DetectContentType(data)),
FileEncSha256: uploaded.FileEncSHA256,
FileSha256: uploaded.FileSHA256,
FileEncSHA256: uploaded.FileEncSHA256,
FileSHA256: uploaded.FileSHA256,
FileLength: proto.Uint64(uint64(len(data))),
ContextInfo: opts,
},
Expand All @@ -119,14 +120,14 @@ func (client *NewClientImpl) SendDocument(from types.JID, data []byte, fileName
}
resultDoc := &waProto.Message{
DocumentMessage: &waProto.DocumentMessage{
Url: proto.String(uploaded.URL),
URL: proto.String(uploaded.URL),
DirectPath: proto.String(uploaded.DirectPath),
MediaKey: uploaded.MediaKey,
FileName: proto.String(fileName),
Caption: proto.String(caption),
Mimetype: proto.String(http.DetectContentType(data)),
FileEncSha256: uploaded.FileEncSHA256,
FileSha256: uploaded.FileSHA256,
FileEncSHA256: uploaded.FileEncSHA256,
FileSHA256: uploaded.FileSHA256,
FileLength: proto.Uint64(uint64(len(data))),
ContextInfo: opts,
},
Expand All @@ -142,9 +143,9 @@ func (client *NewClientImpl) DeleteMsg(from types.JID, id string, me bool) {
client.WA.SendMessage(context.Background(), from, &waProto.Message{
ProtocolMessage: &waProto.ProtocolMessage{
Type: waProto.ProtocolMessage_REVOKE.Enum(),
Key: &waProto.MessageKey{
Key: &waCommon.MessageKey{
FromMe: proto.Bool(me),
Id: proto.String(id),
ID: proto.String(id),
},
},
})
Expand Down Expand Up @@ -247,12 +248,12 @@ func (client *NewClientImpl) SendSticker(jid types.JID, data []byte, opts *waPro

client.WA.SendMessage(context.Background(), jid, &waProto.Message{
StickerMessage: &waProto.StickerMessage{
Url: proto.String(uploaded.URL),
URL: proto.String(uploaded.URL),
DirectPath: proto.String(uploaded.DirectPath),
MediaKey: uploaded.MediaKey,
Mimetype: proto.String(http.DetectContentType(data)),
FileEncSha256: uploaded.FileEncSHA256,
FileSha256: uploaded.FileSHA256,
FileEncSHA256: uploaded.FileEncSHA256,
FileSHA256: uploaded.FileSHA256,
FileLength: proto.Uint64(uint64(len(data))),
ContextInfo: opts,
},
Expand Down
6 changes: 3 additions & 3 deletions src/libs/parsed.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"

"go.mau.fi/whatsmeow"
waProto "go.mau.fi/whatsmeow/binary/proto"
waProto "go.mau.fi/whatsmeow/proto/waE2E"
"go.mau.fi/whatsmeow/types/events"
"google.golang.org/protobuf/proto"
)
Expand Down Expand Up @@ -112,7 +112,7 @@ func NewSmsg(mess *events.Message, sock *NewClientImpl, jdbot ...bool) *IMessage
}(),
QuotedMsg: mess.Message.GetExtendedTextMessage().GetContextInfo(),
ID: &waProto.ContextInfo{
StanzaId: &mess.Info.ID,
StanzaID: &mess.Info.ID,
Participant: proto.String(mess.Info.Sender.String()),
QuotedMessage: mess.Message,
},
Expand All @@ -132,7 +132,7 @@ func NewSmsg(mess *events.Message, sock *NewClientImpl, jdbot ...bool) *IMessage
}(),
Reply: func(text string, opts ...whatsmeow.SendRequestExtra) (whatsmeow.SendResponse, error) {
return sock.SendText(mess.Info.Chat, text, &waProto.ContextInfo{
StanzaId: &mess.Info.ID,
StanzaID: &mess.Info.ID,
Participant: proto.String(mess.Info.Sender.String()),
QuotedMessage: mess.Message,
}, opts...)
Expand Down