mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 20:50:22 +03:00
Remove hacky print
This commit is contained in:
parent
3cc5bef700
commit
aee04eefe8
|
@ -273,22 +273,10 @@ class InteractiveTelegramClient(TelegramClient):
|
||||||
print('No profile picture found for this user!')
|
print('No profile picture found for this user!')
|
||||||
|
|
||||||
elif msg == '!i':
|
elif msg == '!i':
|
||||||
blacklist_attrs = ['from_reader', 'on_response', 'pretty_format', 'resolve', 'rpc_error',
|
attributes = list(entity.to_dict().items())
|
||||||
'serialize_bytes', 'serialize_datetime', 'stringify', 'to_dict',
|
pad = max(len(x) for x, _ in attributes)
|
||||||
'constructor_id', 'subclass_of_id', 'confirm_received', 'result']
|
for name, val in attributes:
|
||||||
interesting_attributes = [
|
print("{:<{width}} : {}".format(name, val, width=pad))
|
||||||
x for x in dir(entity)
|
|
||||||
if x.lower() not in blacklist_attrs and not (x.startswith('_') or x.startswith('__'))
|
|
||||||
]
|
|
||||||
|
|
||||||
longest_attr = max(len(x) for x in interesting_attributes)
|
|
||||||
|
|
||||||
for attr in interesting_attributes:
|
|
||||||
print("{:<{width}} : {}".format(
|
|
||||||
attr,
|
|
||||||
getattr(entity, attr, ''),
|
|
||||||
width=longest_attr)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Send chat message (if any)
|
# Send chat message (if any)
|
||||||
elif msg:
|
elif msg:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user