Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error in dis-bot.pyw file #56

Closed
CaptainRexPL opened this issue Jul 16, 2022 · 14 comments
Closed

[Bug]: Error in dis-bot.pyw file #56

CaptainRexPL opened this issue Jul 16, 2022 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@CaptainRexPL
Copy link

Contact Details

No response

What happened?

When I try to turn the discord bot on using dis-bot.pyw I get an error:
Checking scan
Checking status
Checking list
Testing:False, Debugging:True

Starting bot...
Starting emergency bot...
Checking scan
Checking status
Checking list
Could not prepare the client:
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 352, in _ready
await self.__sync()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 429, in __sync
_guilds = await self._http.get_self_guilds()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\http\guild.py", line 30, in get_self_guilds
if guild.get("id"):
AttributeError: 'str' object has no attribute 'get'
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000002186DC77520>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000002186F73C700>, 10669.937)]']
connector: <aiohttp.connector.TCPConnector object at 0x000002186DC77C40>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001D9524C36D0>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001D952FE7AC0>, 10668.281)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001D9524C3DF0>

At first I thought that I insterted something wrong in settings.json file or I have incompatible packages but after checking the settings.json file and reinstalling the packages the error is still the same.
My settings.json file:
{
"TOKEN":"token insterted",
"lower_ip_bound":"11.0.0.0",
"upper_ip_bound":"255.255.255.255",
"threads":1020,
"timeout":6000,
"os":1,
"home-dir": "(directory)",
"user":"Pilot1782",
"password":"Password123",
"guild-id": 963804208430198824,
"server":false,
"server-port":"8080",
"masscan":false,
"time2":1000,
"lin-py":"python3",
"win-py":"%LOCALAPPDATA%\Programs\Python\Python310\python.exe",
"debugging":true,
"testing":false
}

I have this error on the newest dev build.

Version

1.9.1 (Default)

Relevant log output

No response

@CaptainRexPL CaptainRexPL added the bug Something isn't working label Jul 16, 2022
@Pilot1782
Copy link
Owner

Try resetting your token and then reinserting it into the settings file. If that doesn't work turn on testing and move copy the relevant values into the .env file.

1 similar comment
@Pilot1782
Copy link
Owner

Try resetting your token and then reinserting it into the settings file. If that doesn't work turn on testing and move copy the relevant values into the .env file.

@CaptainRexPL
Copy link
Author

I tried both solutions and they doesn't work. The error is still the same.

@Pilot1782
Copy link
Owner

I'll be back at my pc in a few hours and hopefully be able to replicate it.

@Mankifg
Copy link

Mankifg commented Jul 18, 2022

i also have this error, if you nead any data that i can give just tell me

@Pilot1782 Pilot1782 mentioned this issue Aug 3, 2022
@CaptainRexPL
Copy link
Author

I tried the stable version with the latest commits and after some little modifications like fixing the path to the correct one I get a new error.
Checking scan
Checking status
Checking list
Testing:False, Debugging:True

Starting bot...
Starting emergency bot...
path: (correct path here)
Checking scan
Checking status
Checking list
The HTTP client has encountered a per-route ratelimit. Locking down future requests for 0.969 seconds.

The HTTP client has exhausted a per-route ratelimit. Locking route for 1.0 seconds.
The HTTP client has exhausted a per-route ratelimit. Locking route for 58.784 seconds.

I tried lowering the threads from 1020 to even 5, but still the error is the same. Another problem is that the bot actually turn on, but trying to use command /status gives another error:
Scan of 123.123.123.123 requested.
C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcstatus\utils.py:104: DeprecationWarning: 'MinecraftServer' is deprecated and is expected to be removed on 2022-08, use 'JavaServer' instead.
warnings.warn(warn_message, category=DeprecationWarning)
Failed to scan 123.123.123.123.
timed out
C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcstatus\utils.py:104: DeprecationWarning: 'MinecraftServer' is deprecated and is expected to be removed on 2022-08, use 'JavaServer' instead.
warnings.warn(warn_message, category=DeprecationWarning)
Failed to query 123.123.123.123

Using /server-scan gives another error:
Process Process-1:
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\multiprocessing\process.py", line 315, in _bootstrap
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\multiprocessing\process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\Kacper\Documents\bad_copenheimer-main-eksperymenty\bad_copenheimer-main\dis-bot.pyw", line 263, in startup
bot.start()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 124, in start
self._loop.run_until_complete(self._ready())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 363, in _ready
await self._login()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 368, in _login
await self._websocket._establish_connection(self._shard, self._presence)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 189, in _establish_connection
await self._handle_connection(stream, shard, presence)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 245, in _handle_connection
await self.__restart()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 150, in __restart
await self._establish_connection()
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 189, in _establish_connection
await self._handle_connection(stream, shard, presence)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 257, in _handle_connection
self._dispatch_event(event, data)
File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 372, in _dispatch_event
self._dispatch.dispatch(_name, *__args, **__kwargs)
File "C:\Users\Kacper\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\dispatch.py", line 37, in dispatch
self.loop.create_task(event(*args, **kwargs))
TypeError: server_scan() got an unexpected keyword argument 'lower_ip_bound'

@Pilot1782
Copy link
Owner

I'll look into it when I get back but for the mean time just try adding in time.sleep statements everywhere

@CaptainRexPL
Copy link
Author

CaptainRexPL commented Nov 9, 2022

/server_scan command still doesn't work

@Pilot1782
Copy link
Owner

The latest dev build should be working, I haven't tested out the status range since my server is bugged rn but normal status should work.

@CaptainRexPL
Copy link
Author

/status works
just /server_scan is still broken

@CaptainRexPL
Copy link
Author

I tried the stable version with the latest commits and after some little modifications like fixing the path to the correct one I get a new error. Checking scan Checking status Checking list Testing:False, Debugging:True

Starting bot... Starting emergency bot... path: (correct path here) Checking scan Checking status Checking list The HTTP client has encountered a per-route ratelimit. Locking down future requests for 0.969 seconds.

The HTTP client has exhausted a per-route ratelimit. Locking route for 1.0 seconds. The HTTP client has exhausted a per-route ratelimit. Locking route for 58.784 seconds.

I tried lowering the threads from 1020 to even 5, but still the error is the same. Another problem is that the bot actually turn on, but trying to use command /status gives another error: Scan of 123.123.123.123 requested. C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcstatus\utils.py:104: DeprecationWarning: 'MinecraftServer' is deprecated and is expected to be removed on 2022-08, use 'JavaServer' instead. warnings.warn(warn_message, category=DeprecationWarning) Failed to scan 123.123.123.123. timed out C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\mcstatus\utils.py:104: DeprecationWarning: 'MinecraftServer' is deprecated and is expected to be removed on 2022-08, use 'JavaServer' instead. warnings.warn(warn_message, category=DeprecationWarning) Failed to query 123.123.123.123

Using /server-scan gives another error: Process Process-1: Traceback (most recent call last): File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\multiprocessing\process.py", line 315, in _bootstrap self.run() File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\multiprocessing\process.py", line 108, in run self._target(*self._args, **self._kwargs) File "C:\Users\Kacper\Documents\bad_copenheimer-main-eksperymenty\bad_copenheimer-main\dis-bot.pyw", line 263, in startup bot.start() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 124, in start self._loop.run_until_complete(self._ready()) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1520.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 646, in run_until_complete return future.result() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 363, in _ready await self._login() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\client\bot.py", line 368, in _login await self._websocket._establish_connection(self._shard, self._presence) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 189, in _establish_connection await self._handle_connection(stream, shard, presence) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 245, in _handle_connection await self.__restart() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 150, in __restart await self._establish_connection() File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 189, in _establish_connection await self._handle_connection(stream, shard, presence) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 257, in _handle_connection self._dispatch_event(event, data) File "C:\Users\User\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\gateway\client.py", line 372, in _dispatch_event self._dispatch.dispatch(_name, *__args, **__kwargs) File "C:\Users\Kacper\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\interactions\api\dispatch.py", line 37, in dispatch self.loop.create_task(event(*args, **kwargs)) TypeError: server_scan() got an unexpected keyword argument 'lower_ip_bound'

@Pilot1782 Will /server_scan command get fixed or is it a "won't-fix"?

@Pilot1782
Copy link
Owner

So, the dev build works a lot better right now and I'm in the middle of rewriting the scanner to move to the scanCore file.

@CaptainRexPL
Copy link
Author

I updated the python version and all of the packages. I also updated dis-bot.pyw and funcs.py. And now I get this error:
Task exception was never retrieved future: <Task finished name='Task-20' coro=<server_scan() done, defined at C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\interactions\client\models\command.py:930> exception=TypeError("server_scan() got an unexpected keyword argument 'lower_ip_bound'")> Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\interactions\client\models\command.py", line 970, in wrapper raise e File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\interactions\client\models\command.py", line 939, in wrapper return await coro(ctx, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: server_scan() got an unexpected keyword argument 'lower_ip_bound'

@Pilot1782
Copy link
Owner

Lol I'm working on completely removing the scan feature as it is right now for a better implementation, you can test it out in scanCore.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants