Seems to be bug in tn-cli for 'note' function

18 views
Skip to first unread message

Chariton

unread,
Mar 8, 2024, 1:08:11 PMMar 8
to Tinode General
Even in the example in sample-script.txt it seems to be producing the error. I pasted the output below:
tn> .must set fnd --public=basic:testUser
<= 200 ok (fnd)
tn> .must $meta get fnd --sub
<= meta sub fnd
tn> .must sub $meta.sub[0].user_id
<= 200 ok (usrMZbBHCkAkuQ)
tn> note $meta.sub[0].user_id
<= Error in 'note $meta.sub[0].user_id': int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Gene

unread,
Mar 8, 2024, 1:19:15 PMMar 8
to Tinode General
This error message appears to be valid. Your note command needs more parameters. 

You have the full source code. Please debug first. 
 

Chariton

unread,
Mar 8, 2024, 9:41:49 PMMar 8
to Tinode General
I found out that it's required to add '--seq={seq_id}' at the end of the note function.
Technically this shouldn't be necessary for the kp argument, although it is for the other options, but the code still requires it.
So to get the sample code to work without giving errors, it should look like this:
note $meta.sub[0].user_id kp --seq=1234

I haven't seen any evidence that this does actually give any kind of typing notifications when running an automated script. Maybe because it happens too quickly?

Gene

unread,
Mar 8, 2024, 10:59:43 PMMar 8
to Tinode General
On Friday, March 8, 2024 at 6:41:49 PM UTC-8 Chariton wrote:
I found out that it's required to add '--seq={seq_id}' at the end of the note function.
Technically this shouldn't be necessary for the kp argument, although it is for the other options, but the code still requires it.

Yes, you are welcome to send a pull request with the fix. Thanks.
 
So to get the sample code to work without giving errors, it should look like this:
note $meta.sub[0].user_id kp --seq=1234

I haven't seen any evidence that this does actually give any kind of typing notifications when running an automated script. Maybe because it happens too quickly?

Or maybe you are doing something wrong.
Reply all
Reply to author
Forward
0 new messages