diff --git a/disnake/ext/commands/params.py b/disnake/ext/commands/params.py index 330c3adf9a..cddbda01c0 100644 --- a/disnake/ext/commands/params.py +++ b/disnake/ext/commands/params.py @@ -10,6 +10,7 @@ import itertools import math import sys +import types from abc import ABC, abstractmethod from dataclasses import dataclass from enum import Enum, EnumMeta @@ -755,7 +756,12 @@ def parse_annotation(self, annotation: Any, converter_mode: bool = False) -> boo return True def parse_converter_annotation(self, converter: Callable, fallback_annotation: Any) -> None: - _, parameters = isolate_self(get_signature_parameters(converter)) + if isinstance(converter, (types.FunctionType, types.MethodType)): + converter_func = converter + else: + # if converter isn't a function/method, it should be a callable object/type + converter_func = converter.__call__ + _, parameters = isolate_self(get_signature_parameters(converter_func)) if len(parameters) != 1: raise TypeError(