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

Slash Interactions Should Not Timeout Before RCON Response #17

Open
KOOKIIEStudios opened this issue Feb 9, 2024 · 9 comments
Open

Comments

@KOOKIIEStudios
Copy link
Owner

          > 2024-02-08 13:18:05,487 - client - DEBUG - Lines: [] [2024-02-08 13:18:05] [ERROR ] discord.app_commands.tree: Ignoring exception in command 'online' Traceback (most recent call last): File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 828, in _do_call return await self._callback(interaction, **params) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\PalCON-Discord\main.py", line 106, in online await interaction.response.send_message(embed=embed_message) File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\interactions.py", line 801, in send_message await adapter.create_interaction_response( File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\webhook\async_.py", line 219, in request raise NotFound(response, data) discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction

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

Traceback (most recent call last): File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\tree.py", line 1248, in _call await command._invoke_with_namespace(interaction, namespace) File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 853, in _invoke_with_namespace return await self._do_call(interaction, transformed_values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\MY COM\AppData\Local\Programs\Python\Python311\Lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call raise CommandInvokeError(self, e) from e discord.app_commands.errors.CommandInvokeError: Command 'online' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction

I'm getting an error. I've reinstalled it a few times. I'll try again on another computer for now. Maybe the Python is twisted.

For this one, I'm guessing it's timing out - I'll have to double check the timeout duration for RCON side, to make sure that it's kept within 3 seconds

Although the proper way to handle this is probably to use the .defer() method to allow the slash command to not time out before the internal RCON client gives a response to the Discord bot

Originally posted by @KOOKIIEStudios in #6 (comment)

@ssw1279
Copy link

ssw1279 commented Feb 9, 2024

discord/discord-api-docs#2482
Looking about the delay. I checked the contents like the link. That said, the rental server I use requires around 10s wait time, but the discord bot only supports within 3 seconds. It seems like a crash is happening.

@ssw1279
Copy link

ssw1279 commented Feb 14, 2024

Is it possible to modify utf as well? utf still doesn't work.

@alexraskin
Copy link
Contributor

Is it possible to modify utf as well? utf still doesn't work.

Can you give me some more detail?

Thanks!

@ssw1279
Copy link

ssw1279 commented Feb 15, 2024

2024-02-15 09:04:29,968 - main - ERROR - Unable to fetch/send game server info: 'utf-8' codec can't decode byte 0xec in position 38: invalid continuation byt
e
[2024-02-15 09:04:30] [ERROR ] discord.app_commands.tree: Ignoring exception in command 'info'
Traceback (most recent call last):
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\app_commands\commands.py", line 828, in _do_call
return await self.callback(interaction, **params) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PalCON-Discord\main.py", line 70, in info
await interaction.response.send_message(CONFIG["generic_bot_error"])
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\interactions.py", line 801, in send_message
await adapter.create_interaction_response(
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\webhook\async
.py", line 219, in request
raise NotFound(response, data)
discord.errors.NotFound: 404 Not Found (error code: 10062): Unknown interaction

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

Traceback (most recent call last):
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\app_commands\tree.py", line 1248, in _call
await command._invoke_with_namespace(interaction, namespace)
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\app_commands\commands.py", line 853, in _invoke_with_namespace
return await self._do_call(interaction, transformed_values)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\PalCON-Discord\venv\Lib\site-packages\discord\app_commands\commands.py", line 846, in _do_call
raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'info' raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction

apply the changed main.py to the utf version, it will be output as above. Maybe change it, it looks like the utf coding has changed.

@alexraskin
Copy link
Contributor

@Bratah123 Do you think just calling the .decode("utf-8", errors="ignore") would be enough? I was thinking we could just pass it in when we call get_indices_from_info(res)? Let me know what you think

@Bratah123
Copy link
Collaborator

@Bratah123 Do you think just calling the .decode("utf-8", errors="ignore") would be enough? I was thinking we could just pass it in when we call get_indices_from_info(res)? Let me know what you think

I think this problem isn't related to this issue, it might be non-latin characters messing up again?

@alexraskin
Copy link
Contributor

I think this problem isn't related to this issue, it might be non-latin characters messing up again?

Ah, okay, have you thought about a fix for this? I have one in mind, but curious if you and kookie are already working on something?

@Bratah123
Copy link
Collaborator

I think this problem isn't related to this issue, it might be non-latin characters messing up again?

Ah, okay, have you thought about a fix for this? I have one in mind, but curious if you and kookie are already working on something?

His specific error might be caused by our utf branch of the bot, which was our experimental bot trying to solve this problem.

My solution was to write my own RCON library specifically for palworld.

I'm open to any solutions that are tested though

@alexraskin
Copy link
Contributor

My solution was to write my own RCON library specifically for palworld.

I think this would be fun to try and tackle.

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

4 participants