yagop / telegram-bot

UNMAINTAINED - A Telegram Bot based on plugins
GNU General Public License v2.0
848 stars 502 forks source link

Global messages [news, updates...] #165

Open Josepdal opened 9 years ago

Josepdal commented 9 years ago

Can you create a plugin which allow share messages to all groups and chats? This can be practical for:

rockneurotiko commented 9 years ago

Nice idea! And actually is not difficult at all! Of course, should be a sudo plugin.

Do you want to try it?

Josepdal commented 9 years ago

I haven't got enough knowledge to do it, I think. If you want we can get in contact by telegram and see what we do. @Josepdal

anvaruk commented 9 years ago

official android client broadcast messages are limited to 100 contacts is it the same for API?

Josepdal commented 9 years ago

We send msgs as a normal chat dont do broadcast...

But i cant do it running...

rockneurotiko commented 9 years ago

I've been looking this with @Josepdal time ago (I forgot to comment here...) And we founded something that maybe it's not a good new... I have a plugin that do what it's suposed to do, you tell him a message and the plugin sends it to all chats and users. With my bot it worked well, I don't have many chats/users, but with josep, that had many chats... Didn't worked... Because tg-cli have some limit. The error line was:

telegram-cli: lua-tg.c:1203: parse_lua_function: Assertion `pos + 3 + p < 1000' fail ed.`

I let here the source code that I made, if someone find a solution, would be so great! (I tried many things, like send by groups, or delegate in callbacks... didn't worked :S)

(the source code is how it result after many tests, so if something seems "weird" probably is because of try to do some test XD) Source code of broadcast.lua

CarlosLopezES commented 9 years ago

Hi,

Is this still functional? I'm interested on this. I tried your code but no luck ;(, no error but "Your message had been sended to 0 chats and 0 users"

Thanks!