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

Fixes Persistent not not sending #3324

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

martinbndr
Copy link
Contributor

This PR fixes persistent notes not sending on thread creation.

This error raised:

Task exception was never retrieved
future: <Task finished name='Task-86' coro=<Thread.setup() done, defined at c:\Users\MA\Documents\modmail-dev\devmodmail\core\thread.py:160> exception=TypeError("Thread.setup.<locals>.send_persistent_notes.<locals>.State.store_user() got an unexpected keyword argument 'cache'")>
Traceback (most recent call last):
  File "c:\Users\MA\Documents\modmail-dev\devmodmail\core\thread.py", line 291, in setup
    await asyncio.gather(
  File "c:\Users\MA\Documents\modmail-dev\devmodmail\core\thread.py", line 277, in send_persistent_notes
    message = discord.Message(state=State(), channel=self.channel, data=data)
  File "c:\Users\MA\Documents\modmail-dev\devmodmail\venv\lib\site-packages\discord\message.py", line 1687, in __init__
    getattr(self, f'_handle_{handler}')(data[handler])
  File "c:\Users\MA\Documents\modmail-dev\devmodmail\venv\lib\site-packages\discord\message.py", line 1811, in _handle_author       
    self.author = self._state.store_user(author, cache=self.webhook_id is None)
TypeError: Thread.setup.<locals>.send_persistent_notes.<locals>.State.store_user() got an unexpected keyword argument 'cache'

Maybe not ideal solution but adding the cache arg to the store_user() funtion at line 253 fixes it.

Taaku18 and others added 2 commits November 26, 2023 13:53
This fixes persistent note not sending on thread creation.
@martinbndr
Copy link
Contributor Author

@Taaku18 Please take a look at pr´s like this that fixes relatively small things that are somehow important for small features. These could be released regardless of having a big bot update or not.
Currently if users having persistent notes they won´t get sent after they created a new thread

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

Successfully merging this pull request may close these issues.

2 participants