Skip to content

Commit 9dad167

Browse files
dacid44Toricane
andauthored
fix: Fix commands not being registered properly (#745)
* fix: Fix commands not being registered properly * refactor: remove irrelevant comments * refactor: call register() with name as a kwarg Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
1 parent bb30463 commit 9dad167

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

interactions/client/bot.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,13 +355,15 @@ def event(
355355
"""
356356

357357
def decorator(coro: Coroutine):
358-
self._websocket._dispatch.register(coro, name if name is not MISSING else coro.__name__)
358+
self._websocket._dispatch.register(
359+
coro, name=name if name is not MISSING else coro.__name__
360+
)
359361
return coro
360362

361363
if coro is not MISSING:
362-
self._websocket._dispatch.register(coro, coro.__name__)
363-
# it is not possible to provide a name here since it is only called when you use `@event`
364-
# for a name you would need `@bot.event()`, but this is handled in the decorator function
364+
self._websocket._dispatch.register(
365+
coro, name=name if name is not MISSING else coro.__name__
366+
)
365367
return coro
366368

367369
return decorator

0 commit comments

Comments
 (0)