[CS:S] TypedServerCommand error
Posted: Thu Jul 10, 2025 10:01 am
Hi, i recently updated my code to use TypedServerCommand
The following code does work when type in console test name
but if i restart server then this error appears:
The following code does work when type in console test name
Syntax: Select all
from commands.typed import TypedServerCommand
@TypedServerCommand('test')
def test_command(info, *name_parts: str):
name = ' '.join(name_parts)
print(name)
but if i restart server then this error appears:
Code: Select all
[SP] Caught an Exception:
Traceback (most recent call last):
File "../addons/source-python/packages/source-python/plugins/manager.py", line 437, in _unload_auto_unload_instances
instance._unload_instance()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "../addons/source-python/packages/source-python/commands/typed.py", line 580, in _unload_instance
if self.parser.remove_command(self.commands):
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "../addons/source-python/packages/source-python/commands/typed.py", line 280, in remove_command
return self._remove_command(self._validate_commands(commands))
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "../addons/source-python/packages/source-python/commands/typed.py", line 369, in _validate_commands
raise TypeError('<commands> must be str, list or tuple.')
TypeError: <commands> must be str, list or tuple.