israr-ulhaq / tls_contact_visaBot

3 stars 1 forks source link

RuntimeError: Cannot close a running event loop #1

Open adelabdelli opened 1 week ago

adelabdelli commented 1 week ago

I tried your code but I am getting the following error, do you have any idea ?

runfile('C:/Users/LENOVO/Gate.io/untitled0.py', wdir='C:/Users/LENOVO/Gate.io')
Traceback (most recent call last):

  File ~\AppData\Roaming\Python\Python311\site-packages\telegram\ext\_application.py:1063 in __run
    loop.run_until_complete(self.initialize())

  File C:\ProgramData\anaconda3\Lib\asyncio\base_events.py:629 in run_until_complete
    self._check_running()

  File C:\ProgramData\anaconda3\Lib\asyncio\base_events.py:588 in _check_running
    raise RuntimeError('This event loop is already running')

RuntimeError: This event loop is already running

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File ~\AppData\Roaming\Python\Python311\site-packages\telegram\ext\_application.py:1088 in __run
    loop.run_until_complete(self.shutdown())

  File C:\ProgramData\anaconda3\Lib\asyncio\base_events.py:629 in run_until_complete
    self._check_running()

  File C:\ProgramData\anaconda3\Lib\asyncio\base_events.py:588 in _check_running
    raise RuntimeError('This event loop is already running')

RuntimeError: This event loop is already running

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\users\lenovo\gate.io\untitled0.py:173
    main()

  File c:\users\lenovo\gate.io\untitled0.py:170 in main
    application.run_polling()

  File ~\AppData\Roaming\Python\Python311\site-packages\telegram\ext\_application.py:865 in run_polling
    return self.__run(

  File ~\AppData\Roaming\Python\Python311\site-packages\telegram\ext\_application.py:1093 in __run
    loop.close()

  File C:\ProgramData\anaconda3\Lib\asyncio\selector_events.py:88 in close
    raise RuntimeError("Cannot close a running event loop")

RuntimeError: Cannot close a running event loop
israr-ulhaq commented 1 week ago

Are you running the script in the terminal? if not i would recommend try that to it should not cause same event loop.

adelabdelli commented 1 week ago

Are you running the script in the terminal? if not i would recommend try that to it should not cause same event loop.

No, but after I run it on terminal, nothing happen, I checked I found that the search_appointments() function doesn't run !!! Can you also tell me the purpose of the telegram api here ?

israr-ulhaq commented 6 days ago

You need to create a Telegram API, which is free for basic use. Once you have the API set up, run the script and open Telegram where your channel is located. Use /start to begin the script or /search to trigger the code.

adelabdelli commented 5 days ago

You need to create a Telegram API, which is free for basic use. Once you have the API set up, run the script and open Telegram where your channel is located. Use /start to begin the script or /search to trigger the code.

I did, but the problem is I am getting this error on Telegram bot:

TLS_RDV, [13/11/2024 23:45] An error occurred: Message: Stacktrace: GetHandleVerifier [0x00007FF721BE3AF5+28005] (No symbol) [0x00007FF721B483F0] (No symbol) [0x00007FF7219E580A] (No symbol) [0x00007FF721A35A3E] (No symbol) [0x00007FF721A35D2C] (No symbol) [0x00007FF721A7EA97] (No symbol) [0x00007FF721A5BA7F] (No symbol) [0x00007FF721A7B8B3] (No symbol) [0x00007FF721A5B7E3] (No symbol) [0x00007FF721A275C8] (No symbol) [0x00007FF721A28731] GetHandleVerifier [0x00007FF721ED646D+3118813] GetHandleVerifier [0x00007FF721F26CC0+3448624] GetHandleVerifier [0x00007FF721F1CF3D+3408301] GetHandleVerifier [0x00007FF721CAA44B+841403] (No symbol) [0x00007FF721B5344F] (No symbol) [0x00007FF721B4F4C4] (No symbol) [0x00007FF721B4F65D] (No symbol) [0x00007FF721B3EBB9] BaseThreadInitThunk [0x00007FFC13D6259D+29] RtlUserThreadStart [0x00007FFC14C2AF38+40]

israr-ulhaq commented 4 days ago

Update Chrome and ChromeDriver to the latest versions

adelabdelli commented 4 days ago

I have Chrome 130.0 For the Chrome driver, the I have the latest one which is: 140.

Should I downgrade Chrome??