I try to run Basic commands from telethon in order to connect to Telegram and what I have is two errors:
'AuthMethods._start' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback and DATABASE IS LOCKED
from telethon import TelegramClient, sync
from telethon.tl.functions.messages import GetHistoryRequest
from telethon.errors.rpcerrorlist import RpcMcgetFailError
api_id = xxxxxx
api_hash = 'xxxxxxxxxxxx'
phone_number = '+393333941671'
sesssion_name = 'scraper'
client = TelegramClient(sesssion_name,
api_id,
api_hash)
client = TelegramClient('session_name', api_id, api_hash).start()
Error
__main__:9: RuntimeWarning: coroutine 'AuthMethods._start' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
File "<ipython-input-19-21e0fd5ffefd>", line 11, in <module>
client = TelegramClient('session_name', api_id, api_hash).start()
File "C:\Users\Anca\Anaconda3\Lib\site-packages\telethon\client\telegrambaseclient.py", line 236, in __init__
DEFAULT_PORT
File "C:\Users\Anca\Anaconda3\Lib\site-packages\telethon\sessions\sqlite.py", line 157, in set_dc
self._update_session_table()
File "C:\Users\Anca\Anaconda3\Lib\site-packages\telethon\sessions\sqlite.py", line 183, in _update_session_table
c.execute('delete from sessions')
OperationalError: database is locked