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

not send message #534

Open
parsibox opened this issue May 19, 2015 · 40 comments
Open

not send message #534

parsibox opened this issue May 19, 2015 · 40 comments

Comments

@parsibox
Copy link

hi
i send message to myself
but i can not send any more message
msg command not have any output
is there any limit in telegram api ?

@LukeLR
Copy link

LukeLR commented May 19, 2015

Yes, there are limitations, but they are not set so low that you could reach them with a single message. Usually, when sending multiple messages within seconds, they might appear. Therefore it must be some kind of bug you are experiencing. What exactly did you do? You installed tg-cli, then sent a message to yourself, which worked, but after that the msg-command didn't work anymore?

On 19 May 2015, at 3:33 pm, parsibox notifications@github.com wrote:

hi
i send message to myself
but i can not send any more message
msg command not have any output
is there any limit in telegram api ?


Reply to this email directly or view it on GitHub.

@parsibox
Copy link
Author

yes i install tg-cli
i add 2000 contact
i send 200 message ( may be )
i can now send message to my other number but no new number
for example this command not send message to my friend
msg +989134050600_+989134050600 hi
( is +989134050600 to my contact befor with firstname +989134050600 and lastname +989134050600 )

@parsibox
Copy link
Author

whene i use get user_info it say

user_info +989134050600_+989134050600
User +989134050600 +989134050600 (#76388752):
real name: A.mohamad Vaezi
phone: 989134050600
offline (was online [2015/05/19 11:06:27])

but sending message not work ( msg +989134050600_+989134050600 hi )

@parsibox
Copy link
Author

msg +989132677411_+989132677411 hi
[11:55] +989132677411 +989132677411 <<< hi
msg +989134050600_+989134050600 hi

nothing do with +989134050600
but send message to +989132677411

@luckydonald
Copy link

You could try msg user#76388752 hi
user_info:

User +989134050600 +989134050600 (#76388752):

@gnumoksha
Copy link

@parsibox a @luckydonald trick should be work. But perhaps you wish see https://gist.github.com/gnumoksha/a95f237d82733ce1f748

@parsibox
Copy link
Author

this command also not work

msg user#76388752 hi

@parsibox
Copy link
Author

my output of stats is

stats
users_allocated 290
chats_allocated 0
encr_chats_allocated 0
peer_num 290
messages_allocated 4

also this command for my other number work but for +989134050600_+989134050600 not work

msg user#37712354 hi
[00:37] +989132677411 +989132677411 <<< hi

@gnumoksha
Copy link

@parsibox well, many people have success with user#id syntax (leastwise in 1.2 version). You can try reinitiate the process, add the contacts in address list, execute contact_list and dialog_list before send a message...

@parsibox
Copy link
Author

i try use first contact_list and thene dialog_list and after that send ( msg user#76388752 hi ) bot not work
i say ( msg user#37712354 hi ) work for me ( in my other number ) but on new numbers not work
if you want i can send ssh info of my server to see what happend and fix it
can telegram block my account?

@parsibox
Copy link
Author

please see this image
http://5.9.34.245/tg/Screenshot%20%281318%29.png
please help me
i need working with this api

@gnumoksha
Copy link

The error is:

> msg user#1234567 "testing"
 *** reply_id=0, disable=0
FAIL: 71: RPC_CALL_FAIL 400: PEER_ID_INVALID

while sending or receiving message over telegram-cli.

But api does not explain this

@luckydonald
Copy link

Right, check the output in verbose mode, starting the cli with -vvvv

@LordJohn42
Copy link

Salam.
Thats "msg userName Hello" should be work. On 1.2.0.

@vysheng
Copy link
Owner

vysheng commented May 20, 2015

@gnumoksha Probably you mistyped id or this user is not in your contact list and you don't have his access_hash. If you had any messages with him in the past -W key may help

@vysheng
Copy link
Owner

vysheng commented May 20, 2015

@parsibox probably you hit flood control. Run with -vvvv and look for error messages

@parsibox
Copy link
Author

in -vvv mode it say

msg user#xxxxxx"testing" ( change id )
*** error for query #6150888942118155264: #400 PEER_ID_INVALID

@LordJohn42
Copy link

@parsibox I think id is incorrect. It must be in 12345678 format.
You got this error.
https://core.telegram.org/method/messages.sendMessage

@parsibox
Copy link
Author

no id currect and i can send message to this id now ( i add this user by number in my contact now and then send message )
that command now work
i think it is telegram bug , sometime say this error for me

@luckydonald
Copy link

Does it work, if you rename the contacts, and not phone numbers as names?

@parsibox
Copy link
Author

no i try this yesterday and not worked

@sladec
Copy link

sladec commented May 20, 2015

Don't know if it related ...but I cant send message's unless I start with -W flag or run contact_list first else I get {"error": "can not parse arg #1", "result": "FAIL", "error_code": 38} is this normal ?

@luckydonald
Copy link

That is known. #414 (solution), #406 (solution), #411, #483, #399,

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

now it say to mee
#420 FLOOD_WAIT_86400 (HANDLED)
what is it ?

@vysheng
Copy link
Owner

vysheng commented Jun 1, 2015

you were banned for 86400 seconds (=1 day) for flood.

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

whay telegram ban me?
what is the rule?

@vysheng
Copy link
Owner

vysheng commented Jun 1, 2015

probably you reached limit for number of sent messages. It is unknown what limit do they have.

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

thanks

@jonnywilliamson
Copy link
Contributor

@parsibox just how many messages where you trying to send? How quickly? Did the recipients you were sending to have your number in their phonebook?

All these things likely make a difference.

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

i send about 400 message
with waiting 3 secend
no they do not have my number in theire phonebook
they are users of my site
how can i send about 2,000 message in one theye , with the same note?

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

adding to contact also return error
#420 FLOOD_WAIT_11 (HANDLED)

@LukeLR
Copy link

LukeLR commented Jun 1, 2015

You need to use a Broadcast for messaging so many Users. The broadcast command in the telegram cli is fine for that, you could add all your users to a line of text and pass that the broadcast command. Keep that line saved somewhere so you don't need to re-type all the names the next time. Or you could use one of telegrams desktop or mobile applications, those save previously used broadcast lists, so you can reuse them easily.

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

can you write a sample for using Broadcast command?

@LukeLR
Copy link

LukeLR commented Jun 1, 2015

Of course I can ;) Hold on a sec...
This is an example for the broadcast command using the user-IDs. As shown, you can request them by using the user_info-command.

Last login: Mon Jun  1 19:53:53 on ttys001
Reykjavik:~ Lukas$ ssh pi@192.168.2.101
Linux RPi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun  1 19:53:56 2015 from 192.168.2.104
^[[Api@RPi ~ $ nc localhost 1235
contact_list
ANSWER 19
Raspberry Pi
Lukas

dialog_list
ANSWER 523
...
User xyz: 18 unread
...
User Lukas: 13 unread

user_info Lukas
ANSWER 125
User Lukas @user_name (#12345678):
    real name: Lukas 
    phone: 49xxxxxxxxxx
    offline (was online [2015/06/01 19:50:16])

user_info xyz
ANSWER 124
User xyz @user_xyz (#87654321):
    real name: xyz 
    phone: 49xxxxxxxxxx
    offline (was online [2015/06/01 19:19:36])

broadcast user#12345678 user#87654321 online
ANSWER 8
SUCCESS

^C
pi@RPi ~ $ exit
logout
Connection to 192.168.2.101 closed.
Reykjavik:~ Lukas$ 

@LukeLR
Copy link

LukeLR commented Jun 1, 2015

And this is an example how to use the broadcast command with the screen names as they are shown in contact list or dialog list. Both methods work well for me ;)

Last login: Mon Jun  1 20:08:03 on ttys002
Reykjavik:~ Lukas$ ssh pi@192.168.2.101
Linux RPi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun  1 20:08:05 2015 from 192.168.2.104
pi@RPi ~ $ nc localhost 1235
contact_list
ANSWER 19
Raspberry Pi
Lukas

dialog_list
ANSWER 523
...
User xyz: 18 unread
...
User Lukas: 13 unread

broadcast Lukas xyz test
ANSWER 8
SUCCESS

^C
pi@RPi ~ $ exit
logout
Connection to 192.168.2.101 closed.
Reykjavik:~ Lukas$ exit
logout

[Process completed]

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

thanks a lot
i will test it
do you now how many user i can set in broadcast method ?

@parsibox
Copy link
Author

parsibox commented Jun 1, 2015

i test it but say

broadcast user#111957717 user#109741937 salam
*** arg_num = 3
*** error for query #6155473742309365760: #400 CONTACTS_EMPTY

@parsibox
Copy link
Author

parsibox commented Jun 3, 2015

when i run this command not work

broadcast user#109741937 user#37712354 salam
*** arg_num = 3

@mlkmhd
Copy link

mlkmhd commented Aug 13, 2015

I also have this problem when using broadcast user#EXAMPLE_ID msg return this error:
RPC_CALL_FAIL 400: CONTACTS_EMPTY

but the user has been added to my contacts successfully!

@ghost
Copy link

ghost commented Mar 12, 2017

I have the following exception when trying to send_photo to contact list:
Error 71: u'RPC_CALL_FAIL 400: PEER_FLOOD' (command u"[disable_preview] send_photo contact1 unicode-caption-with-join-link". What's up with the PEER_FLOOD? Any idea @luckydonald ?

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

9 participants