Rhymen / go-whatsapp

WhatsApp Web API
MIT License
2.05k stars 490 forks source link

#588: Add new massages type & update Readme.md #593

Closed Ased2235 closed 3 weeks ago

Ased2235 commented 2 years ago

Added new ListMessage, ListResponseMessage Handers. Update the readme.md with new handler. Added new example

567 #588 @beshoo Check & marge.

image

image

beshoo commented 2 years ago

Great, I wll give it 48 hours, you may want to add something, just to make sure it is final.

Ased2235 commented 2 years ago

@beshoo You may marge it now, this is final as i'm busy for awhile after this!

Valdenirmezadri commented 2 years ago

Hello

I followed the example, but the message is not sent

WhatsApp Image 2021-07-13 at 18 26 26

code:

previousMessage := "teste" quotedMessage := proto.Message{ Conversation: &previousMessage, }

ContextInfo := whatsapp.ContextInfo{
    QuotedMessage:   &quotedMessage,
    QuotedMessageID: "3EB032DF7237E311B457",        //Original message ID
    Participant:     "5547XXXXXXXX@s.whatsapp.net", //Who sent the original message
}

var Section = []whatsapp.Section{
    {
        Title: "Section title 1",
        Rows: []whatsapp.Row{
            {
                Title:       "Row title 1",
                Description: "Row description 1",
                RowId:       "1C61A9BB7F063EEFE235", // no white space in rowid
            },
            {
                Title:       "Row title 2",
                Description: "Row description 2",
                RowId:       "1C61A9BB7F063EXFE225",
            },
        },
    },
}
Section = append(Section, whatsapp.Section{
    Title: "Section title 2",
    Rows: []whatsapp.Row{
        {
            Title:       "Row title 3",
            Description: "Row description 3",
            RowId:       "1C6149BB7F063EEFE225",
        },
    },
},
)

msg := whatsapp.ListMessage{
    Info: whatsapp.MessageInfo{
        RemoteJid: "5547XXXXXXXX-1586836369@g.us",
    },
    ContextInfo: ContextInfo,
    Title:       "This is List *title*",
    Description: "This is List _description_",
    ButtonText:  "This is List buttonText", // ButtonText dosn't support html tag
    FooterText:  "This is List footerText", // this isn't actually showing in whatsapp web
    ListType:    proto.ListMessage_SINGLE_SELECT,
    Sections:    Section,
}
jairforero commented 2 years ago

I also have that error, any solution?, message not sent in whatsapp bussiness

image