Deployment crashes with confusing TypeError

So, I have a piece of code that works flawlessly in my project. But the same piece of code in my newly made template throws a type error.
Traceback (most recent call last):
File "main.py", line 19, in <module>
class AdvancedBot(commands.Bot):
File "main.py", line 78, in AdvancedBot
origin: discord.Message | discord.Interaction,
TypeError: unsupported operand type(s) for |: 'type' and 'type'
Traceback (most recent call last):
File "main.py", line 19, in <module>
class AdvancedBot(commands.Bot):
File "main.py", line 78, in AdvancedBot
origin: discord.Message | discord.Interaction,
TypeError: unsupported operand type(s) for |: 'type' and 'type'
The code:
async def get_context(
self,
origin: discord.Message | discord.Interaction,
/,
*,
cls: Type = None,
) -> Any:
return await super().get_context(origin, cls=cls or CustomContext)
async def get_context(
self,
origin: discord.Message | discord.Interaction,
/,
*,
cls: Type = None,
) -> Any:
return await super().get_context(origin, cls=cls or CustomContext)
1 Reply
Percy
Percy14mo ago
Project ID: 16b0d354-c84e-417f-8c4b-612269819c51