Skip to content

Commit 8c9524a

Browse files
committed
fix: add support for sync functions
1 parent 40c3fc8 commit 8c9524a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

interactions_restful/extension.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from interactions import Client
77

8-
from .abc import BaseApi, BaseRouter
8+
from .abc import BaseApi
99

1010
__all__ = ("APIClient", "setup")
1111
API_TYPE = TypeVar("API_TYPE", bound=BaseApi)
@@ -34,15 +34,15 @@ def _run_api_thread_worker(self):
3434
def _register_extension_routes(self):
3535
for extension in self.bot.ext.values():
3636
has_methods = False
37-
for _, coro in getmembers(extension, predicate=asyncio.iscoroutinefunction):
38-
if not hasattr(coro, "__api__"):
37+
for _, coro in getmembers(extension):
38+
if getattr(coro, "__api__", None) is None:
3939
continue
4040

4141
has_methods = True
4242

4343
if getattr(extension, "router", None) is None:
4444
extension.router = self.client.create_router(name=extension.name)
45-
data = coro.__api__
45+
data: dict = coro.__api__
4646
extension.router.add_endpoint_method(coro, data["endpoint"], data["method"], **data["kwargs"])
4747

4848
if has_methods:

0 commit comments

Comments
 (0)