-
Notifications
You must be signed in to change notification settings - Fork 23
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
add text styling support #42
Conversation
/deploy |
Pull Request has been deployed on test.pypi.org: 0.8.0a1703799240 🚀 You can test the package by running pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple signalbot==0.8.0a1703799240 |
Thanks a lot for the PR! Very easy solution. I wasn't aware that the HTTP wrapper supports formatting. It will be available in the next release. Until then, you can use the test version from above. There is only one thing. I was planning to refactor the project to be independent of the backend (signal-http-wrapper, signald) but it looks like the formatting is only available in the http wrapper. Though, I will deal with that then later (if ever). |
Maybe another thing. Can you add your format example in the https://github.com/filipre/signalbot/tree/master/example/commands folder? Right now, documentation is not there yet and there aren't types either, so at least we have the |
@filipre sure, I'll add the example. is it ok if I create a there is only one thing that is puzzling me and that is the
No mention of
So not sure what you want to do while one of the options is not working. UPDATE: it doesn't work in |
@filipre done, there's always time to change it. |
ok nevermind, it works in |
@filipre I just tried to install this package using the exact command posted by the bot, but it seems like this version doesn't include my commits. I just tried in a fresh Docker container ( |
/deploy |
Pull Request has been deployed on test.pypi.org: 0.8.0a1704439123 🚀 You can test the package by running pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple signalbot==0.8.0a1704439123 |
I was a bit busy, but will look at it on the weekend |
Merged, let me know if the new version causes issues. Thanks again for your contribution! |
just deployed my app with the new version, everything's working as expected! thanks again 😃 |
Add support for Signal text styling.
In Signal the only way to apply text styling is through the UI, but https://github.com/AsamK/signal-cli supports both reading and setting text styles.
Example from
signal-cli
logs:As you can see also from the text parser in https://github.com/bbernhard/signal-cli-rest-api, text styling through API is realized using familiar markdown:
**word**
for bold*word*
for italic~word~
forstrikethrough||word||
for ||spoiler||`word`
formonospaced text
So the styling is done directly in the text using a very small subset of markdown syntax, and it's only necessary to set
text_mode
to styled in the payload to enable it.Since parsing is handled upstream, in
signalbot
I only introduced support for specifyingtext_mode="styled"
in the payload when sending messages.I tested it with a modified minimal example:
If
text_mode
is not set, it defaults tonormal
(so without styling).