Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline Textmessage #42

Closed
LouisSchieferle opened this issue Jan 24, 2022 · 7 comments
Closed

Multiline Textmessage #42

LouisSchieferle opened this issue Jan 24, 2022 · 7 comments

Comments

@LouisSchieferle
Copy link

Is it possible to send multiline textmessages with whatsapp without all of them being a separate text-message

@ronivaldo
Copy link

I am having the same issue here

@gogardini
Copy link

I have the same issue, I tried many times using different characters and there is no way.

@adesr
Copy link

adesr commented Feb 18, 2022

hello, we found this workaround from someone's answer in StackOverflow thread and we can use it sucessfully. the idea is to split NewLines in message and simulate SHIFT+ENTER to browser.

for msg in message.split("\n"):
    input_box.send_keys(msg)
    ActionChains(self.browser).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.ENTER).key_up(Keys.SHIFT).perform()
input_box.send_keys(Keys.ENTER)

@Kalebu
Copy link
Owner

Kalebu commented Feb 18, 2022

Hi @adesr, This is cool, can you submit a pull request so we can this to the main distribution

Thank you
kalebu

@setijo
Copy link

setijo commented Mar 7, 2022

from alright import WhatsApp
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.keys import Keys
import time
import datetime

chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-notifications")
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--verbose')
chrome_options.add_argument('--disable-software-rasterizer')
driver = webdriver.Chrome(executable_path = '/usr/bin/chromedriver' ,chrome_options = chrome_options)

messenger = WhatsApp()
messenger.find_user('62xxxxxxxxx')
messages = 'baris1\nbaris2\nbaris3'
messages = messages.replace("\n",(Keys.SHIFT+Keys.ENTER+Keys.SHIFT))

messenger.send_message(messages)
time.sleep(5)
messenger.close()

@euriconicacio
Copy link
Collaborator

Hi @adesr, This is cool, can you submit a pull request so we can this to the main distribution

Thank you kalebu

@Kalebu I'll add this to my current PR since it's really useful and the OP has not sent it, ok?

@euriconicacio
Copy link
Collaborator

euriconicacio commented Jun 6, 2022

Addressed through PR #58. 🙃
Should we close this, @Kalebu ?

@Kalebu Kalebu closed this as completed Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants