Closed vevsvevs closed 4 years ago
can you provide an example JSON content of a multistring message, then I can have a look at the problem.
Do you mean smth like this?
["ok"] true
["result",0,"update_id"] 115013438
["result",0,"message","message_id"] 1585
["result",0,"message","from","id"] 558398329
["result",0,"message","from","is_bot"] false
["result",0,"message","from","first_name"] "vevs"
["result",0,"message","from","username"] "vevsvevs"
["result",0,"message","from","language_code"] "ru"
["result",0,"message","chat","id"] 558398329
["result",0,"message","chat","first_name"] "vevs"
["result",0,"message","chat","username"] "vevsvevs"
["result",0,"message","chat","type"] "private"
["result",0,"message","date"] 1592991924
["result",0,"message","text"] "string 1
string 2
string 3"
Ok, I see, usually Telegram send this as: ["result",0,"message","text"] "string1\nstring2\nstring3"
I'll have a look
if I send my bot
test1 test2 test3
I got: ["result",0,"message","text"] "test1\ntest2\ntest3"
how did you create the multi line message?
By writing several words followed by "enter" :) Tested with 2.1.13 desktop and 6.2.0 (1988) Android versions, same result: I get linefeed (newline), not "\n". Maybe you're using non-Unicode client implementation or smth?
thats really strange, if've test it with with Abdroid 6.2.0 and Telegram web and I got "test\ntest\ntest".
Nevertheless I'll try to implement a solution ...
even I cannot reproduce it, I implemented a solution to "merge" multiline strings in one line: https://github.com/topkecleon/telegram-bot-bash/commit/ea92c55c0c0a33b31a1f2a79de9802dd9634e41b
to investigate further: pls open a chat with my bot user @Deal_O_Mat_bot
name DealOMat
and send a multi line message like you described:
multi
line
test
Gnadelwartz
then I can consult my logfiles to see if I find more information about your issue
to investigate further: pls open a chat with my bot user
@Deal_O_Mat_bot
nameDealOMat
and send a multi line message like you described:
Done, please check.
thanks for this, unfortunately my bot was down this afternoon because of connection problems, can you repeat the test again, pls
@gnadelwartz sure, done :)
thanks, the result is the same as with my tests:
["result",0,"message","text"] "multi\nline\ntest\nGnadelwartz"
I see some possibilities for this:
nevertheless, the fix should hopefully make bashbot working for you. try current master.
@gnadelwartz yep, now it works perfectly, thank you!
Sorry for disturbing, but I've faced probably a related issue: now multi-string replies don't handle properly.
Also, seems like something is wrong with the debug feature: bashbot.log collects every message without debug option, and no log file created at all with this option.
bashbot shoild log every activity (with the first 50 char of the message text) in all cases.
the difference is: with debug errors und additionally logging is done in debug log and full message content is logged in message log.
I'll check what's happen with and without debug in a fresh Installation
Sorry for disturbing, but I've faced probably a related issue: now multi-string replies don't handle properly.
hm, really strange, your Telegram server seems to handle Multiline totally different than the one used for my bot. where are you located?
so for example what's te result if send a message like
send_normal_message "CHAT[ID]" "This is\na muli line\nmessage"
or
send_normal_message "CHAT[ID]" "This is
a muli line
message"
try if it's working better if you comment out this line
Sorry for the delay, I have some trouble, I'll try to check in next couple days.
I'll close the issue until you provide more feedback as it seems very specific to your environment
removed json.sh flag -s in development version, let's see if it works better...
6ec00d49b3e1510fb3edb2122524dd7c606ddf74
no response, let's close
Describe the bug New Json2Array sed regex pattern doesn't work well with multi-string messages.
To Reproduce Send any multi-string message to the bot and try to see MESSAGE contain.
Expected behavior MESSAGE should contain the whole text.
Screenshots If applicable, add screenshots to help explain your problem.
Bashbot (please complete the following information):
Additional context Add any other context about the problem here.