[SVN] updated to version 0.3.1
[DEP] [BROKE] new dependency: pytz (pip3 install pytz)
[FIX] fixed media downloading with telethon 0.18
[FIX] now using server time zone in status messages instead of UTC
[UPD] now removing chats & supergroups completely after we leaving with !leave command
[ADD] added commands:
!remove — completely remove current user from contact list
!import phone firstname lastname — try to add contact with phone number (untested)
This commit is contained in:
@@ -27,7 +27,7 @@ import os
|
||||
import queue
|
||||
import threading
|
||||
import time
|
||||
from xmpp_tg.utils import display_tg_name
|
||||
from xmpp_tg.utils import localtime, display_tg_name
|
||||
|
||||
from .utils import var_dump
|
||||
import traceback
|
||||
@@ -181,7 +181,7 @@ class TelegramGateClient(TelegramClient):
|
||||
if type(obj.status) is UserStatusOnline:
|
||||
self._status_updates[str(obj.user_id)] = { 'status': None, 'message': 'Online' }
|
||||
elif type(obj.status) is UserStatusOffline:
|
||||
self._status_updates[str(obj.user_id)] = { 'status': 'xa', 'message': obj.status.was_online.strftime('Last seen at %H:%M %d/%m/%Y') }
|
||||
self._status_updates[str(obj.user_id)] = { 'status': 'xa', 'message': localtime(obj.status.was_online).strftime('Last seen at %H:%M %d/%m/%Y') }
|
||||
elif type(obj.status) is UserStatusRecently:
|
||||
self._status_updates[str(obj.user_id)] = { 'status': 'away', 'message': 'Last seen recently' }
|
||||
else:
|
||||
@@ -324,7 +324,7 @@ class TelegramGateClient(TelegramClient):
|
||||
attr_v = self.get_document_attribute(attributes, DocumentAttributeFilename)
|
||||
video_file = '|File:{}'.format(attr_v.file_name)
|
||||
|
||||
if media.caption:
|
||||
if hasattr(media, 'caption'):
|
||||
caption = media.caption + ' '
|
||||
|
||||
# Тоже свой формат
|
||||
@@ -335,7 +335,7 @@ class TelegramGateClient(TelegramClient):
|
||||
|
||||
self._media_queue.put({'media': media, 'file': g_link['name']})
|
||||
|
||||
if media.caption: # Если есть описание - указываем
|
||||
if hasattr(media, 'caption'): # Если есть описание - указываем
|
||||
msg = '{} {}'.format(media.caption, msg)
|
||||
|
||||
elif type(media) is MessageMediaContact: # Контакт (с номером)
|
||||
|
||||
Reference in New Issue
Block a user