Skip to content

Commit

Permalink
Add simple validation
Browse files Browse the repository at this point in the history
  • Loading branch information
tandemdude committed Jun 27, 2024
1 parent 3bebf35 commit 57b289c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions fragments/+loadable_multi_listen.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add ability for `Loadable.listener`s to listen for multiple event types.
2 changes: 2 additions & 0 deletions lightbulb/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ def listener(
async def message_create_listener(event: hikari.MessageCreateEvent) -> None:
...
"""
if not event_types:
raise ValueError("you must specify at least one event type")

def _inner(
callback: t.Callable["t.Concatenate[EventT, ...]", t.Awaitable[None]],
Expand Down

0 comments on commit 57b289c

Please sign in to comment.