haha
This commit is contained in:
@@ -37,9 +37,10 @@ async def create_telegram_client(server_type):
|
||||
try:
|
||||
|
||||
base_dir = Path(__file__).parent.parent
|
||||
session_path = base_dir / "sessions" / server_type.phone
|
||||
|
||||
client = TelegramClient(
|
||||
fr"sessions\{server_type.phone}",
|
||||
str(session_path),
|
||||
api_id=server_type.api_id,
|
||||
api_hash=server_type.api_hash,
|
||||
system_lang_code=server_type.system_lang_code,
|
||||
@@ -192,8 +193,8 @@ async def start_task(server):
|
||||
|
||||
def check_exist_session_file(phone):
|
||||
base_dir = Path(__file__).parent.parent
|
||||
path = fr"sessions\{phone}.session"
|
||||
is_exist_session_file = os.path.isfile(path)
|
||||
path = base_dir / "sessions" / f"{phone}.session"
|
||||
is_exist_session_file = path.is_file()
|
||||
if not is_exist_session_file:
|
||||
logger.error(f'未找到session文件:{path}')
|
||||
return False
|
||||
@@ -216,7 +217,7 @@ def main1(server_id):
|
||||
|
||||
def main():
|
||||
devices = TgPhoneDevices1.select().where(
|
||||
TgPhoneDevices1.is_valid_session.is_null(),
|
||||
TgPhoneDevices1.is_valid_session.is_null(False),
|
||||
# TgPhoneDevices.phone.is_null(False)
|
||||
# TgPhoneDevices.device_start.is_null()
|
||||
# TgPhoneDevices.kick_status.is_null()
|
||||
|
||||
Reference in New Issue
Block a user