Skip to content

Commit

Permalink
chore: move annotations into EventData.__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv committed Jun 13, 2023
1 parent 0b5f68b commit 5875706
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions disnake/_event_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,21 @@


class EventData:
type_args: Tuple[str, ...]
"""Type names of event arguments, e.g. `("Guild", "User")`"""

bot: bool
"""Whether the event is specific to ext.commands"""

event_only: bool
"""Whether the event can only be used through `@event` and not other listeners"""

def __init__(
self,
*,
type_args: List[str],
bot: bool = False,
event_only: bool = False,
) -> None:
self.type_args = tuple(type_args)
self.bot = bot
self.event_only = event_only
self.type_args: Tuple[str, ...] = tuple(type_args)
"""Type names of event arguments, e.g. `("Guild", "User")`"""

self.bot: bool = bot
"""Whether the event is specific to ext.commands"""

self.event_only: bool = event_only
"""Whether the event can only be used through `@event` and not other listeners"""


EVENT_DATA: Dict[Event, EventData] = {
Expand Down

0 comments on commit 5875706

Please sign in to comment.