Official Telethon's chat! Rules: • Speak English • Stay on topic (questions about Telethon) • Be respectful • Don't ask to ask • Spam-related uses lead to ban • Read https://docs.telethon.dev before asking things here Read more about us @TelethonUpdates
If in my decorator codes there were any wrapper then it will include all of *args and **kwards that makes lambda unuseful
Читать полностью…hello guys
I have a request for development on teleton, but there are several points that previous coders could not solve, namely, they could not implement viewing telegram stories from the list of usernames from txt and also directly from the group list.
if you have experience with something similar, I will be glad to discuss it in private messages, it is advisable to find an adequate experienced performer,
preferably Russian-speaking
Check if group is private or no
Then simply implement what you need your self
No, I checked this, they are simple users, I think the problem is the chat supergroup
Читать полностью…hi
In some events, strangely, users do not have username or usernames
But when I check through Telegram, they have usernames!
i use this code:
sender = await event.get_sender()Читать полностью…
print(sender.username, sender.usernames)
https://docs.telethon.dev/en/stable/modules/events.html#telethon.events.callbackquery.CallbackQuery
How can I filter from_users in his EventUpdateBuilder ?
I saw both data and pattern parameters can recieve a callable but I don't know how should be its input ( like lambda event : .... or not ? ) and which one should I choose ( data or pattern parameter )
I was just curious about how it can be done most natively :)
Читать полностью…answering to myself:
it's possible to define separate html tag in extensions/html.py
with args['collapsed'] = True
so that it would pass the flag to an entity and it would show correctly, but for some reason I was unable to adopt TG representation of a tag <blockquote expandable></blockquote>, so I settled with <blockexp></blockexp>
I'm trying something like this but it's not being executed (the log.message)
try:Читать полностью…
c.bot.run_until_disconnected()
finally:
logger.info("Force flushing before shutdown!")
c.bot.loop.run_until_complete(db.flush_task(force=1))
adding collapsed
bool to a types.MessageEntityBlockquote
class, based on examples for other types...
here's patched class:
class MessageEntityBlockquote(TLObject):Читать полностью…
CONSTRUCTOR_ID = 0x20df5d0
SUBCLASS_OF_ID = 0xcf6419dc
def __init__(self, offset: int, length: int, collapsed: Optional[bool]=None):
"""
Constructor for MessageEntity: Instance of either MessageEntityUnknown, MessageEntityMention, MessageEntityHashtag, MessageEntityBotCommand, MessageEntityUrl, MessageEntityEmail, MessageEntityBold, MessageEntityItalic, MessageEntityCode, MessageEntityPre, MessageEntityTextUrl, MessageEntityMentionName, InputMessageEntityMentionName, MessageEntityPhone, MessageEntityCashtag, MessageEntityUnderline, MessageEntityStrike, MessageEntityBankCard, MessageEntitySpoiler, MessageEntityCustomEmoji, MessageEntityBlockquote.
"""
self.offset = offset
self.length = length
self.collapsed = collapsed
def to_dict(self):
return {
'_': 'MessageEntityBlockquote',
'offset': self.offset,
'length': self.length,
'collapsed': self.collapsed
}
def _bytes(self):
return b''.join((
b'\xd0\xf5\r\x02',
struct.pack('<i', self.offset),
struct.pack('<i', self.length),
struct.pack('<I', (0 if self.collapsed is None or self.collapsed is False else 1)),
))
@classmethod
def from_reader(cls, reader):
flags = reader.read_int()
_collapsed = bool(flags & 1)
_offset = reader.read_int()
_length = reader.read_int()
return cls(offset=_offset, length=_length, collapsed=_collapsed)
After the action, the account continues to remain online. Maybe it sends some requests and catches the ban?
Читать полностью…Pass your filter as pattern, it should return Bool
Now see if it works or not
This problem is related to some supergroups with many members, other groups do not have this problem.
Читать полностью…I think this problem is a bit strange because when users reply to me, telethon displays the username correctly, but when the same user sends a message in the same group normally, it shows the username as None.
Читать полностью…It's related to what get_sender returns
Info about group or user
I mean a query.user_id for from_users
If Telethon doesn't support something like this please let me know for me to coding a private decorator to use
you don't necessarily need to modify the library or use html.
adjust the wiki hyperlink hack for quotes too, so something like this for markdown case
used as usual urls [text](quote)
or [text](quote-collapse)
or whatever
of course after doing client.parse_mode = CustomMarkdown()
well ok, it was pretty dumb of me to not update first :P
but still... how do I write the code to indicate I want a collapsed quote?..