Python telethon как подписаться с нескольких аккаунтов
Всем привет, пишу бота с помощью telethon, при подписке сессий на полный адрес телеграмма, выдает ошибку:
.\sub.py:16: RuntimeWarning: coroutine 'UserMethods.__call__' was never awaited
join = client(tl.functions.channels.JoinChannelRequest(channel))
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'UserMethods.__call__' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'UserMethods.get_entity' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
ВОТ КОД ПРОГРАММЫ
import telethon as tl
from telethon import TelegramClient
import os
if __name__ == '__main__':
api_id = # секретные данные
api_hash = '' #тоже секретные данные
client = TelegramClient('session_name', api_id, api_hash)
client.start()
session = []
url = input('Введите адресс: ') #адрес канала телеграмм
channel = client.get_entity(url)
for adress, dirs, files in os.walk('.\sessions'):
for file in files:
join = client(tl.functions.channels.JoinChannelRequest(channel))
os.path.join(adress, file)
print(session)