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

Hangouts message being sent in a single line even if newline character is present. #479

Open
Yagyansh opened this issue Sep 11, 2019 · 3 comments

Comments

@Yagyansh
Copy link

I am able to send a hangouts message of more than one line with newline between them. All of the lines gets sent in the single line. Tried inserting the newline character in many ways but nothing worked. Can somebody help on this?

@Yagyansh Yagyansh changed the title Sending a hangouts message with newline present in it. Hangouts message being sent in a single line even if newline character is present. Sep 11, 2019
@Yagyansh Yagyansh reopened this Sep 11, 2019
@tdryer
Copy link
Owner

tdryer commented Sep 12, 2019

You might need to add a line break segment to the message instead of using a newline character.

@Yagyansh
Copy link
Author

Yagyansh commented Sep 12, 2019

@tdryer Can you be a little more specific on how? Because I have tried a lot but it gets sent in the same line only.

@tdryer
Copy link
Owner

tdryer commented Sep 13, 2019

ChatMessageSegment.from_str can parse a string into segments for you. For example:

>>> import hangups
>>> hangups.ChatMessageSegment.from_str("hello\nworld")
[<hangups.conversation_event.ChatMessageSegment object at 0x7f9b5c1bf080>, <hangups.conversation_event.ChatMessageSegment object at 0x7f9b5c1bf048>, <hangups.conversation_event.ChatMessageSegment object at 0x7f9b570641d0>]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants