staciax / valorant-discord-bot

A discord bot with valorant api.
GNU General Public License v3.0
333 stars 204 forks source link

/login issue #83

Closed nagisa404 closed 1 year ago

nagisa404 commented 1 year ago

Ive changed the host of the bot and since im facing the issue that the bot is not responding to the /login command - afaik all other command semm to work but I can not test properly since login isnt working for me.

Console responds with this when using /login:

Task exception was never retrieved future: <Task finished name='CommandTree-invoker' coro=<CommandTree._from_interaction..wrapper() done, defined at /home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py:1087> exception=ValueError('Both or neither of value and tb must be given')> Traceback (most recent call last): File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 850, in _do_call return await self._callback(self.binding, interaction, **params) # type: ignore File "/home/container/cogs/valorant.py", line 93, in login authenticate = await auth.authenticate(username, password) File "/home/container/utils/valorant/auth.py", line 120, in authenticate data = await r.json() File "/home/container/.local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json raise ContentTypeError( aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://auth.riotgames.com/api/v1/authorization')

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1240, in _call await command._invoke_with_namespace(interaction, namespace) File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 876, in _invoke_with_namespace return await self._do_call(interaction, transformed_values) File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/commands.py", line 869, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'login' raised an exception: ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://auth.riotgames.com/api/v1/authorization')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1089, in wrapper await self._call(interaction) File "/home/container/.local/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1244, in _call await self.on_error(interaction, e) File "/home/container/cogs/errors.py", line 65, in on_app_command_error traceback.print_exception(type(error), error) File "/usr/local/lib/python3.10/traceback.py", line 116, in print_exception value, tb = _parse_value_tb(exc, value, tb) File "/usr/local/lib/python3.10/traceback.py", line 95, in _parse_value_tb raise ValueError("Both or neither of value and tb must be given") ValueError: Both or neither of value and tb must be given Unclosed client session client_session: <utils.valorant.auth.ClientSession object at 0x7f6af47e6f80> Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x7f6af51b29e0>, 58355373.88184868)]'] connector: <aiohttp.connector.TCPConnector object at 0x7f6af47e6d40>

Any recommendations what I could try to fix this?

staciax commented 1 year ago
staciax commented 1 year ago

if you is dev

floxay riot auth : https://github.com/floxay/python-riot-auth/blob/main/riot_auth/auth.py

update ssl context in utils/valorant/auth.py

I haven't updated in quite a while.

I will update it when I finished coding the new version and I reworked all the code.

nagisa404 commented 1 year ago

its a linux virtual server and Im using py3.10

my coding knowledge is very basic but I could try.

jacky50403 commented 1 year ago

Will the Docker image get update? The same problem seems to happen on Docker image.

marchingon12 commented 1 year ago

@jacky50403 unfortunately the Docker image has been set to update whenever theres a new major release with version tagging (on Github's releases) at Releases. The owner is busy and has not notified whether there will be a new release or not, as the latest version still has the bug. Please run the bot using the source code for now thank you.

iGetUploaded commented 1 year ago

@jacky50403 unfortunately the Docker image has been set to update whenever theres a new major release with version tagging (on Github's releases) at Releases. The owner is busy and has not notified whether there will be a new release or not, as the latest version still has the bug. Please run the bot using the source code for now thank you.

Tried running the src code from here and I just get a big error.. Filled everything in that was asked as well https://sourceb.in/LaHguReE9U