Describe the bug
Error raised when closing group conversation and the thread channel is not getting deleted.
Bot Info
Bot version (check with @modmail about):
-v3.10.0-dev3
Host method (Heroku, self-host, etc):
-Self-host
To Reproduce
Steps to reproduce the behavior:
Who can reproduce (ex. anyone, owners)?
Supporters
Where can it be reproduced (ex. in thread channels, recipient DM's)?
Thread channel
Done what to cause the error?
Close the thread using ?close command.
Any recently made changes to your bot?
No
Errored
Error Logs
06/24/21 21:45:37 __main__[1562] - ERROR: Unexpected exception:
Traceback (most recent call last):
File "C:\Users\Username\.virtualenvs\Modmail-Y9MQGjgg\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\Username\Projects\Modmail\cogs\modmail.py", line 421, in close
await thread.close(closer=ctx.author, after=close_after, message=message, silent=silent)
File "C:\Users\Username\Projects\Modmail\core\thread.py", line 408, in close
await self._close(closer, silent, delete_channel, message)
File "C:\Users\Username\Projects\Modmail\core\thread.py", line 505, in _close
message = self.bot.formatter.format(
File "C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\string.py", line 163, in format
return self.vformat(format_string, args, kwargs)
File "C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\string.py", line 167, in vformat
result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
File "C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\string.py", line 177, in _vformat
self.parse(format_string):
File "C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\string.py", line 261, in parse
return _string.formatter_parser(format_string)
TypeError: expected str, got NoneType
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\Username\.virtualenvs\Modmail-Y9MQGjgg\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Username\.virtualenvs\Modmail-Y9MQGjgg\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\Username\.virtualenvs\Modmail-Y9MQGjgg\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: expected str, got NoneType
C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\asyncio\events.py:81: RuntimeWarning: coroutine 'Messageable.send' was never awaited
self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\Username\AppData\Local\Programs\Python\Python38-32\lib\asyncio\events.py:81: RuntimeWarning: coroutine 'ConfigManager.update' was never awaited
self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Describe the bug Error raised when closing group conversation and the thread channel is not getting deleted.
Bot Info Bot version (check with
@modmail about
): -v3.10.0-dev3
Host method (Heroku, self-host, etc): -Self-host
To Reproduce Steps to reproduce the behavior:
Supporters
Thread channel
?close
command.No
Error Logs
Additional context I believe the error was raised from here: https://github.com/kyb3r/modmail/blob/e79432525fde5efe69550fa7d70bf01eb2be80d3/core/thread.py#L505-L507 when the
message
was None.