[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:
@@ -3,9 +3,12 @@
|
||||
"""
|
||||
|
||||
import types
|
||||
import time
|
||||
import pytz
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
|
||||
def display_tg_name(peer):
|
||||
if hasattr(peer,'title') and hasattr(peer,'broadcast') and peer.broadcast: # channel
|
||||
return '[C] ' + peer.title
|
||||
@@ -36,6 +39,14 @@ def get_contact_jid(peer, gatejid):
|
||||
else:
|
||||
return None
|
||||
|
||||
def localtime(utc_dt):
|
||||
if time.daylight:
|
||||
offsetHour = time.altzone / 3600
|
||||
else:
|
||||
offsetHour = time.timezone / 3600
|
||||
local_tz = pytz.timezone('Etc/GMT%+d' % offsetHour)
|
||||
local_dt = utc_dt.replace(tzinfo = pytz.utc).astimezone(local_tz)
|
||||
return local_tz.normalize(local_dt)
|
||||
|
||||
def var_dump(obj, depth=7, l=""):
|
||||
# fall back to repr
|
||||
|
||||
Reference in New Issue
Block a user