you can, same as usual Telegram apps. only the account fetching the comment can send_message to it
Читать полностью…Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon
, since most problems have already been fixed in newer versions.
unless you set multiple different handlers to trigger on addition, a func is useless. code usually, see beginning of /channel/TelethonChat/611007
Читать полностью…But it also might to handle also when your client adds somebody else , then you can simply filter the adder
Читать полностью…Outgoing include actions from host of your client
Incoming is on the otherside for other accounts
Or you can simply set outgoing=True and then use lambda e : e.user_added as func in the decorator
Читать полностью…So when bot gets added, the ChatAction event user_added
is True and user_joined
is False, right? And how do I filter it using a func
so I only catch events where my bot was added? Should I do like func=lambda e: e.user_id == my_bot_id or my_bot_id in e.user_ids
?
And can I use func=lambda e: client.id in e.user_ids
as suggested above, or e.user_ids
may be not populated? (and I have to call get_input_users()
)
I'm trying to use EditChatTitleRequest, but:
Error: Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited
An example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead (caused by EditChatTitleRequest)
How ever it's a mega group and I passed the chat id like -1001231231231
func = lambda event : event.user_added and event.user_joined and client.id in event.user_ids
According to the docs, e.outgoing is only mentioned on a NewMessage
event, not ChatAction
So when someone adds my bot to a group - that is an outgoing event for my bot, right?
Читать полностью…What's out
? outgoing?
Wouldn't that catch all "user_added" events? I need only those, which is about my self (my bot)
from telethon.extensions.markdown import parseЧитать полностью…
from telethon.extensions.html import unparse
print(unparse(*parse(original_text)))
I wrote all of text strings of my bot with Markdown parse mode symptoms and now I should re-write them all with HTML signs._.
Читать полностью…