fixes
This commit is contained in:
parent
cb13fbf21a
commit
12fc75622e
@ -14,15 +14,15 @@ class Bot():
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
session_file: str,
|
session_file: str,
|
||||||
config_file: str,
|
config_file: str,
|
||||||
api_id: str,
|
api_id: int,
|
||||||
api_hash: int,
|
api_hash: str,
|
||||||
owner_id: int) -> None:
|
owner_id: int) -> None:
|
||||||
self.__config_file = config_file
|
self.__config_file = config_file
|
||||||
self.__config = None
|
self.__config = None
|
||||||
self.__me = None
|
self.__me = None
|
||||||
self.__owner_id = owner_id
|
self.__owner_id = owner_id
|
||||||
self.__reload()
|
self.__reload()
|
||||||
self.__bot = TelegramClient(session_file, api_id, api_hash)
|
self.__bot = TelegramClient(session=session_file, api_id=api_id, api_hash=api_hash)
|
||||||
self.__weather_queue = Queue()
|
self.__weather_queue = Queue()
|
||||||
|
|
||||||
@self.__bot.on(events.NewMessage(incoming=True, pattern='!whoami'))
|
@self.__bot.on(events.NewMessage(incoming=True, pattern='!whoami'))
|
||||||
|
@ -18,12 +18,14 @@ tz_msk = dt.timezone(offset=delta, name="MSK")
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
session_file = os.environ['SESSION_FILE']
|
session_file = os.environ['SESSION_FILE']
|
||||||
api_id = os.environ['TG_APP_ID']
|
app_id = int(os.environ['TG_APP_ID'])
|
||||||
api_hash = os.environ['TG_APP_HASH']
|
api_hash = os.environ['TG_APP_HASH']
|
||||||
owner_id = int(os.environ['TG_OWNER_ID'])
|
owner_id = int(os.environ['TG_OWNER_ID'])
|
||||||
config_file = os.environ['CONFIG_FILE']
|
config_file = os.environ['CONFIG_FILE']
|
||||||
|
logger.info(f"SESSION_FILE: {session_file}")
|
||||||
|
logger.info(f"CONFIG_FILE: {config_file}")
|
||||||
bot = Bot(session_file=session_file,
|
bot = Bot(session_file=session_file,
|
||||||
api_id=api_id,
|
api_id=app_id,
|
||||||
api_hash=api_hash,
|
api_hash=api_hash,
|
||||||
config_file=config_file,
|
config_file=config_file,
|
||||||
owner_id=owner_id)
|
owner_id=owner_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user