kragebein / pubg.reportbot

Pubg report discord bot.
8 stars 6 forks source link

Not working, outdated files #4

Open SaturnusDJ opened 1 year ago

SaturnusDJ commented 1 year ago

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 commented 1 year ago

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 https://github.com/kragebein/pubg.reportbot/issues/3#issuecomment-1295446920 both version 'trees' (1.7.3 and 2.1.0) are working now.

SaturnusDJ commented 1 year ago

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

Applied the mentioned patches, and made some further adjustments.