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

Not working, outdated files #4

Open
SaturnusDJ opened this issue Jan 26, 2023 · 2 comments
Open

Not working, outdated files #4

SaturnusDJ opened this issue Jan 26, 2023 · 2 comments

Comments

@SaturnusDJ
Copy link

Got this error. Environment is Alpine Linux, which is extremely minimal, so that might have to do with it, but not sure how to move this further.

/pubg.reportbot-master # python3.10 pubgbot.py 
pubg.report bot v1.2
WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported
/usr/lib/python3.10/site-packages/aiohttp/connector.py:964: RuntimeWarning: coroutine 'TCPConnector._resolve_host' was never awaited
  hosts = await asyncio.shield(self._resolve_host(
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "/pubg.reportbot-master/pubgbot.py", line 15, in <module>
    client.run(bot_token)
  File "/usr/lib/python3.10/site-packages/discord/client.py", line 678, in run
    return future.result()
  File "/usr/lib/python3.10/site-packages/discord/client.py", line 658, in runner
    await self.start(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/discord/client.py", line 621, in start
    await self.login(*args, bot=bot)
  File "/usr/lib/python3.10/site-packages/discord/client.py", line 472, in login
    await self.http.static_login(token.strip(), bot=bot)
  File "/usr/lib/python3.10/site-packages/discord/http.py", line 288, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "/usr/lib/python3.10/site-packages/discord/http.py", line 185, in request
    async with self.__session.request(method, url, **kwargs) as r:
  File "/usr/lib/python3.10/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/usr/lib/python3.10/site-packages/aiohttp/client.py", line 480, in _request
    conn = await self._connector.connect(
  File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 523, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 858, in _create_connection
    _, proto = await self._create_direct_connection(
  File "/usr/lib/python3.10/site-packages/aiohttp/connector.py", line 964, in _create_direct_connection
    hosts = await asyncio.shield(self._resolve_host(
TypeError: shield() got an unexpected keyword argument 'loop'
@SaturnusDJ SaturnusDJ changed the title RuntimeWarning: coroutine 'TCPConnector._resolve_host' was never awaited Not working, outdated files Jan 26, 2023
@SaturnusDJ
Copy link
Author

SaturnusDJ commented Jan 26, 2023

An update, one step further. It seems like the old Discord version (1.4.1) does not work. 1.7.3 does run, but still not work. Picked this also out of date version because of the following.

Updated to 2.1.0 and the error is as described here: https://stackoverflow.com/questions/73397992/discord-py-cannot-find-reference-requestswebhookadapter
Patched it like that.

Following error is as on https://stackoverflow.com/questions/71959420/client-init-missing-1-required-keyword-only-argument-intents
Patched like described.

And back to the first sentence of this post, with the addition that now 2 INFO log lines appear, as shown below.

Log:

/pubg.reportbot-master # python3.10 pubgbot.py 
pubg.report bot v1.2
WARNING:discord.client:PyNaCl is not installed, voice will NOT be supported
2023-01-26 20:38:29 INFO     discord.client logging in using static token
INFO:discord.client:logging in using static token
2023-01-26 20:38:30 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX).
INFO:discord.gateway:Shard ID None has connected to Gateway (Session ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX).
Loading external assets..Loaded
Bot is now running.

# Clients have to use !register command to register themselves.
# !unregister to unregister
# The command !test <pugbname> is also available to see if
  the bot has successfully located them on pubg.report


Checking pubg.report now!

Below that it posts the usernames of people chatting, so it does seem to be able to read (permission checks confirm this), but it does not seems to respond to commands.

EDIT
Sent the bot the commands as private message. That brings up a response. Is that how it is supposed to work? Nothing more happens though.

EDIT2
After the 'weapon' fix by #3 (comment) both version 'trees' (1.7.3 and 2.1.0) are working now.

@SaturnusDJ
Copy link
Author

https://github.com/SaturnusDJ/pubg.report-discord-bot

Applied the mentioned patches, and made some further adjustments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant