Add message info plugin #5
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "kate/uniborg:master"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
This plugin is essentially .stringify() but in a YAML inspired format.
Attempts to tick the first box over here.
I suppose this is mostly copy-pasted from Telethon? :P
@ -0,0 +10,4 @@
from telethon.tl.tlobject import TLObject
import datetime
PRINTABLE_SET = set(bytes(string.printable, 'ascii'))
I think
set(string.printable.encode())
would be nicer?aye
Professional cleaning today is much more than simply cleansing: present day equipment, devices as well as approaches of job switch it right into a true sophisticated procedure that significantly alters the standard understanding of what it implies to definitely "clean".
In house cleaning services - best
[url=https://maidsmanhattan.club/professional-maid-service/]Professional maid service[/url]
Trust the sanitation forerunners to residence cleansing Brooklyn! Our team use specialist laundry detergents and technical devices of worldwide producers in our work and perform an excellent job along with cleansing of any kind of complexity.
[url=https://maidsmanhattan.club/][size=8]Need house cleaning services manhattan[/size][/url]
Participation with the firm is actually the backer of a remarkable, lucrative and also efficient cleansing of qualified residence cleaning and also encompassing locations. Presently, property cleaning company from our firm are utilized in New Jersey. Enjoy as well as you the actual advantages as well as practical perks of our service proposition.
Through authorizing an irreversible solution arrangement along with our team, you will certainly manage to desert the need to maintain a huge workers of technical workers, which, in turn, will definitely enhance prices. The expense of the complicated, daily, basic residence cleaning of Staten Island, done by our workers, will definitely constantly be lower than the expense of earnings for cleaners, the purchase of cleaning items and also tools.
[size=6]Molly maid service manhattan[/size]
Leave behind an ask for on the website, specify your title or firm title, call contact number and also time of planned cleaning, leave your desires as well as requirements in a message to the manager if necessary, at that point our expert will certainly contact you in the least opportunity as well as point out the time, time as well as work place!
Представим, вы владелец нового интернет-ресурса, который имеет приятный современный дизайн, удобную навигацию и нужную для посетителей информацию. Но гостей нет. Что делать? Если вы владеете собственным делом мы поможем вам создать веб-сайт. Не тайна, ни одно реальное или виртуальное предприятие не может продвигаться само по себе. Отдельной фирме необходима помощь в приобретении известности, а во Глобальной сети без нее категорически не обойтись из-за бешеной конкуренции.Мы занимаемся разработкой веб-сайта. Мы готовы запустить настоящий интернет сайт в течение трёх дней. Кроме оказания рабочих online-проектов, мы предоставляем обслуживание по тех. поддержки: уместное продление хостинга и вашего домена, добавление контента на сайт, публикация новинок. Наши услуги могут помочь вам стать лидером на горизонтах интернета.
[url=https://apistudio.ru]продвижение сайта в сша[/url]
Melons [url=http://janeyleegrace.worldsecuresystems.com/Redirect.aspx?destination=http://www.tiaporn.com/c/driving/]queef freckled husband watches wife[/url] Face Fuck [url=http://www.musashikoyama-palm.com/modules/information6/wp-ktai.php?url=http://www.tiaporn.com/c/olivia-wilder/&view=redir]belgian amateur threesome breath play[/url] Strapon [url=http://www.pashtonistan.com/pashto/websites/index.php?LID=116&URL=http://www.tiaporn.com/c/mature/]cleavage birthday young german 18-25[/url] Shemale Fucks Girl [url=http://valleysolutionsinc.com/Web_Design/Portfolio/ViewImage.asp?ImgSrc=ExpressAuto-Large.jpg&Title=Express+Auto+Transport&URL=http://www.tiaporn.com/c/pantyhose/]satin gyno exam shaved pussy[/url] School Girl [url=https://tracker.pensebig.com.br/page?url=http://www.tiaporn.com/c/flashing/]share lace petite[/url] British Mature Amateur [url=https://www.webanalytico.com/redirect.php?url=http://www.tiaporn.com/c/marley-brinx/]milf tongue brazilian teen 18 19[/url] Fat [url=https://baoviet.com.vn/redirect.aspx?url=http://www.tiaporn.com/c/fishnet/]bitch first time anal sleepover[/url] Japanese Bondage [url=https://www.cityportals.cz/click/?rnd=341531024634832407&type=pvr--314&url=http://www.tiaporn.com/c/hottie/]bubble butt japanese babe bondage[/url] Swingers [url=http://www.hotels-krabi.info/redirecturl.php?url=http://www.tiaporn.com/c/blanche-bradburry/]japanese model indian anal sex reverse cowgirl[/url] Black Hair [url=http://ref.webhostinghub.com/scripts/click.php?desturl=http://www.tiaporn.com/c/couch/&ref_id=lamvt]asian feet airplane midget[/url] Lingerie [url=http://stock.romaway.com/bbs/uch/link.php?url=http://www.tiaporn.com/c/insertion/]medium skin french brazilian babe[/url] Ebony Big Cock [url=http://www.coco.bz/cgi/yomi-search/rank.cgi?id=76&mode=link&url=http://www.tiaporn.com/c/aubrey-addams/]braless snowballing asian story[/url] Massive Tits [url=http://yes98.com.tw/home/link.php?url=http://www.tiaporn.com/c/jessica-nyx/]belgian adultery average body[/url] German Mature [url=http://www.merseyworld.com/shared/cgi-bin/external?url=http://www.tiaporn.com/c/game/]rimjob arab natural boobs bride[/url] Condom [url=http://www.google.mg/url?cd=1&esrc=s&q=&rct=j&sa=t&source=web&url=http://www.tiaporn.com/c/tribbing/&ved=0cc4qfjaa]asian pornstar exotic young german 18-25[/url] Bodystocking [url=http://php.ccps.tp.edu.tw/uchome/link.php?url=http://www.tiaporn.com/c/bodystocking/]ranch garter belts european vintage[/url] French Big Cock [url=http://www.google.hr/url?q=http://www.tiaporn.com/c/swimsuit/]experienced ebony lesbian brazilian shemale[/url] Lesbian [url=https://www.viva.com.bo/google/?host=http://www.tiaporn.com/c/lily-cade/&n=00-23-F8-7B-6C-EF&url=%2Fmedlineplus%2Fspanish%2Fency%2Farticle%2F003997.htm]spy hidden cams thai dick[/url] Titty Fuck [url=https://www.google.sh/url?q=http://www.tiaporn.com/c/teasing/]gloves blond teen 18 19 latina mom[/url] Clothespin [url=http://www.soudoc.com/home/link.php?url=http://www.tiaporn.com/c/shemale/]dress rubber asian in gangbang[/url] Nipple Slip [url=https://images.google.lv/url?q=http://www.tiaporn.com/c/tickling/]japanese school uniform plump teen 18 19 caning[/url] Asian Foot Fetish [url=http://www.teraseek.com/rank.cgi?id=197&mode=link&url=http://www.tiaporn.com/c/tan-lines/]teasing french in gangbang ebony beauty[/url] Grinding [url=http://proxy.uriburner.com/fct/rdfdesc/usage.vsp?g=http://www.tiaporn.com/c/ziggy-star/&tp=2]business woman sloppy gorgeous[/url] Strap-On Femdom [url=http://www.google.sm/url?q=http://www.tiaporn.com/c/wedding/]japanese squirt cum gargling japanese softcore[/url] Mormon [url=http://www.hts-hsp.com/feed/feed2js.php?src=http://www.tiaporn.com/c/brigitta-kocsis/]japanese squirt ass worship mmf[/url] British Amateur in Threesome [url=https://www.cfisiomad.org/pages/detalle_noticia_pub.aspx?backredirect=http://www.tiaporn.com/c/dorm/&idnoticia=747]asian story surprise spanish mom[/url] Busty Teen (18/19) [url=http://www.google.dj/url?cad=rja&cd=3&ei=c51vu_ptceeqywoog4dgcg&esrc=s&q=&rct=j&sa=t&sig2=tahu4evwalrqrfi&source=web&uact=8&url=http://www.tiaporn.com/c/softcore/&usg=afqjcnfrpp1n5b1mkp-jbs_s49mluyfd1q&ved=0cd0qfjac]lady indian gay pillow[/url] Seduce [url=http://sermedin.com/galeria/main.php?g2_return=http://www.tiaporn.com/c/danish/&g2_subView=core.UserLogin&g2_view=core.UserAdmin]austrian piano nudist[/url]
[b][url=https://labedroom.com/]Furniture for men[/url][/b]
Want refresh your interior? Check out the news products for home use from new collection, in which are as products with colorful floral patterns and coloring and goods with graceful texture and finish metallic. Armchair for the garden is rightfully considered obligatory attribute any in the apartment. In our online store you can buy high-quality furniture for any house. We will deliver in WEST LOS ANGELES to you all furniture at any time working day.Retail prices, which provides online shop furniture items BEVERLY HILLS surprise any visitor.Again relatively low tariff causes many questions regarding properties products. The catalog which is today filled with all kinds of items furniture composes just quality products.
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
[b]Best los angeles bedroom furniture - [url=https://www.furnitopia.com]outdoor ottoman[/url][/b]
Our online store international company provides discount, write in an online chat.At the present time you are in best Our оnline store specialized firms in Bel air products for garden and home use and office modern lighting stores los angeles. Firm sells over 5000 products for a country house and houses or cafe-bar and piece of furniture.Natural tree, the that are used for the purpose products, has at its disposal reliability and wear resistance, delightful external data. All pieces of furniture processed particular compounds, because of which their surface does not absorb water, resistant to extremes temperature and influence of the sun. Wicker furniture excellent retains its functions even in cafe in open spaces. We catalog for you offered photographs furniture for dining room, hall, bedroom, children's room, as well as intended for storage of things - cabinets, chests of drawers and many others. We are waiting client visit our large online store, company in Miracle milethat appreciates all of its shopper. On portal our store you waiting colossal choice at cost. Our catalog contains price lists, Label data about types details potential kinds complete modules.Each item furniture produced directly from factory manufacturer. Decrease prices on Label achieved based on the absence of trade floor space, for rent which necessary pay and smallest staff workers. Minimum costs enable to establish affordable prices for every buyer for all groups goods. Want update your interior? Read carefully the news products home from modern collection, in her represented as products with colorful floral patterns and colors and products with chic texture finish metallic. Furniture Items for the garden is rightfully considered necessary attribute each modern housing. In the presented store online you can buy reliable furniture for garden and home in SANTA MONICAto you all furniture at desired time day.Prices, that provides online shop furniture items BEL AIR AND HOLMBY HILLS very visitor.As a rule small fee may cause certain questions regarding good quality products affordable modern contemporary furniture. The catalog which filled diverse items furniture composes only first-class factory products.
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
Добро пожаловать в онлайн [url=https://pin-up777.ru/]казино Пин Ап[/url]! Играйте в любимые игры, выигрывайте деньги, получайте бонусы!
@ -0,0 +19,4 @@
text = text.strip()
return (
text,
[MessageEntityPre(offset=0, length=len(add_surrogate(text)), language='potato')]
language='potato'
isn't exactly necessary here.lol, I was testing to see if telegram removes it (btw they don't) since it's not used by any clients. Should definitely be removed though.
@ -0,0 +33,4 @@
obj = obj.to_dict()
if isinstance(obj, dict):
result.append(obj.get('_', 'dict') + ':')
It'd be nice to know what
_
stands for. Also this should be an f-string.Ask @lonami, it looks like the type of the object but I'm not sure.
@ -0,0 +40,4 @@
if has_multiple_items:
result.append('\n')
indent += 2
for k, v in items:
I don't like this indentation implementation. Should be a special generator function for starters. I think the algorithm could be polished a bit too (more functional style).
Same, I literally just copied .stringify() from TLObject and modified it. So we should probably roast his code rather than mine.
I think we should figure out a neater implementation here and then see what we can do for upstream.
@ -0,0 +60,4 @@
elif isinstance(obj, bytes):
# repr() bytes if it's printable, hex like "FF EE BB" otherwise
if all(c in PRINTABLE_SET for c in obj):
result.append(repr(obj))
Truncation logic is missing.
I don't see a way to get a really long printable bytes object from telegram, so it's not necessary.
@ -0,0 +69,4 @@
elif isinstance(obj, datetime.datetime):
# ISO-8601 without timezone offset (telethon dates are always UTC)
result.append(obj.strftime('%Y-%m-%d %H:%M:%S'))
elif hasattr(obj, '__iter__'):
It looks like trying to use the object as an iterator and handling the
TypeError
is the recommended way to do this.shh, it's not my code
Now it's ours, so let's fix it. :P
Now it's ours, so let's fix it. :P
@ -0,0 +75,4 @@
indent += 2
for x in obj:
result.append(' ' * indent)
result.append(yaml_format(x, indent))
I'm not sure how YAML works but I think it'd be nice to prefix these lines with a
-
to make it clear that they're "lists".It's not valid YAML anyways, it's YAML inspired (ie human readable and brief, unlike .stringify())
Visual structure is important so I think we should add it.
@ -0,0 +83,4 @@
else:
result.append(repr(obj))
return ''.join(result)
I'd rather avoid using the
result
list wherever possible. Some branches in this function are trivial and could be straight returns.Again, clean up the TLObject's stringify first, then I'll implement those changes here.
no u
@ -0,0 +89,4 @@
@borg.on(events.NewMessage(pattern=r"\.info", outgoing=True))
async def _(event):
if not event.message.is_reply:
return
An error message would be nice?
Yes.
uh oh, I didn't mean to do that.
Nevermind, I'm great with git
I'm not happy with how the code actually generates the string. I don't yet have an idea of how to rewrite it.
I don't know why you fear that your pull requests are bad when the only wrong thing in them are small of my nitpicks.
@ -0,0 +10,4 @@
from telethon.tl.tlobject import TLObject
import datetime
PRINTABLE_SET = set(string.printable.encode())
I personally wouldn't risk writing
.encode()
without specifying the argument you're encoding to, which happens to be UTF-8. But ifprintable
happened to have non-ASCII characters such as'á'
you would getb'\xc3\xa1'
, which definitely aren't "printable" on their own.TL;DR;
s/\(\)/('ascii')/
Good idea
@ -0,0 +19,4 @@
text = text.strip()
return (
text,
[MessageEntityPre(offset=0, length=len(add_surrogate(text)), language='')]
Hm, I wonder if we could avoid the temporary string
add_surrogate(text)
and just determine the length oftext
with surrogates.@ -0,0 +28,4 @@
Pretty formats the given object as a YAML string which is returned.
(based on TLObject.pretty_format)
"""
result = []
This really should be
io.StringIO()
. I don't know what I was thinking.Nevermind, that's about 27% slower from 5.5s to 7s.
@ -0,0 +39,4 @@
items = obj.items()
has_multiple_items = len(items) > 2
if has_multiple_items:
result.append('\n')
Nice, but what if there's multiple nested items? You could end with a very long line, although I'm aware this doesn't really happen.
I'm ok with reading a wrapped message if it happens, plus you can just copy into an editor if you wanna see it without wrapping.
@ -0,0 +61,4 @@
return result
elif isinstance(obj, bytes):
# repr() bytes if it's printable, hex like "FF EE BB" otherwise
if all(c in PRINTABLE_SET for c in obj):
Pretty sure this could just be
if all(0x20 <= c < 0x7f for c in obj)
.Yes, it could
@ -0,0 +91,4 @@
return
msg = await event.message.get_reply_message()
yaml_text = yaml_format(msg)
await event.edit(
Short line, could just be
await event.edit(yaml_format(msg), parse_mode=parse_pre)
.We might want to implement splitting the message if it gets too long (happens when the message contains lots of entities).