Jump to content
Fivewin Brasil

whatsapp


sistem

Recommended Posts

  • 3 weeks later...
 

Melhor alterar a URL DE: https://api.whatsapp.com/send?phone= PARA: https://web.whatsapp.com/send?phone= ... veja exemplo:


Function Whatsapp1(cPara, cMsg, cDe)
 Local oShell, oClp, hBmp := FWSaveScreen(GetDesktopWindow())

  DEFAULT cDe   := "Jose teste"
  DEFAULT cPara := "5585900001111"
  DEFAULT cMsg  := "MESSAGEM para whatsapp"

  DEFINE CLIPBOARD oClp FORMAT BITMAP OF oWndP
  oClp:Open()
  oClp:SetBitmap( hBmp )
  oClp:Close()

  oShell := CreateObject( "WScript.Shell" )
  oShell:run("chrome.exe https://web.whatsapp.com/send?phone="+cPara)
  Sleep(5000)
  oShell:sendkeys("*"+cDe+"*")
  oShell:SendKeys("~")
  oShell:sendkeys("_"+cMsg+"_")
  oShell:SendKeys("~")
  oShell:sendkeys("^(v)")   // Ctrl+v
  Sleep(2500)
  oShell:sendkeys("_mensagem automatica_")
  oShell:SendKeys("~")

Return nil

informando que existe uma API oficial (WhatsApp Business) assim não vai precisar usar a gambiarra acima, veja: https://developers.facebook.com/docs/whatsapp/getting-started

 

 

 

desta forma esta abrindo a pagina do whatsapp com contato, mas não escreve a mensagem e envia...

alguem mas testou assim...

Link to comment
Share on other sites

 

Melhor alterar a URL DE: https://api.whatsapp.com/send?phone= PARA: https://web.whatsapp.com/send?phone= ... veja exemplo:


Function Whatsapp1(cPara, cMsg, cDe)
 Local oShell, oClp, hBmp := FWSaveScreen(GetDesktopWindow())

  DEFAULT cDe   := "Jose teste"
  DEFAULT cPara := "5585900001111"
  DEFAULT cMsg  := "MESSAGEM para whatsapp"

  DEFINE CLIPBOARD oClp FORMAT BITMAP OF oWndP
  oClp:Open()
  oClp:SetBitmap( hBmp )
  oClp:Close()

  oShell := CreateObject( "WScript.Shell" )
  oShell:run("chrome.exe https://web.whatsapp.com/send?phone="+cPara)
  Sleep(5000)
  oShell:sendkeys("*"+cDe+"*")
  oShell:SendKeys("~")
  oShell:sendkeys("_"+cMsg+"_")
  oShell:SendKeys("~")
  oShell:sendkeys("^(v)")   // Ctrl+v
  Sleep(2500)
  oShell:sendkeys("_mensagem automatica_")
  oShell:SendKeys("~")

Return nil

informando que existe uma API oficial (WhatsApp Business) assim não vai precisar usar a gambiarra acima, veja: https://developers.facebook.com/docs/whatsapp/getting-started

 

 

 

System. Bom dia. Qual a versão do seu Five ?
Esta dando erro aqui pra mim.

 

Link to comment
Share on other sites

 

amigo altera o numero 


5585900001111

para um numero valido 55=brasil + DDD 85=ceara + o numero do celular. esse numero que vai receber a msg :)

simples assim

 

Sistem. Eu já fiz isso . Já troquei para o ddd do meu celular
Oq. faltava na verdade era o código do País "55" devido a eu ter utilizado seu primeiro exemplo pra chamar q. não tem este código
for x=1 to 10
    Whatsapp("85999999999", "859999904"+strzero(x,2), "msg teste"+strzero(x,2))
next
e com a inclusão do 55 passa a funcionar

 

Uma coisa q. percebi é que a cada chamada da função ele abre uma nova aba no crome. Isso é normal ou teria como configurar pra ele continuar na mesma aba ?

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...