From d7bc7a8958d3a5f1139cd9d0a75b2914f1c2658b Mon Sep 17 00:00:00 2001 From: Crussader <75786691+Crussader@users.noreply.github.com> Date: Wed, 20 Oct 2021 22:12:07 +0400 Subject: [PATCH] updated player.py updated with `__call__` dunder. --- pomice/player.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pomice/player.py b/pomice/player.py index b5c40fc..abfb696 100644 --- a/pomice/player.py +++ b/pomice/player.py @@ -29,9 +29,14 @@ class Player(VoiceProtocol): await ctx.author.voice.channel.connect(cls=pomice.Player) ``` """ + def __call__(self, client: ClientType, channel: VoiceChannel): + self.client: ClientType = client + self.channel : VoiceChannel = channel - def __init__(self, client: ClientType, channel: VoiceChannel): - super().__init__(client=client, channel=channel) + return self + + def __init__(self, client: ClientType = None, channel: VoiceChannel = None, **kwargs): + # super().__init__(client=client, channel=channel) self.client = client self._bot = client @@ -51,6 +56,7 @@ class Player(VoiceProtocol): self._ending_track: Optional[Track] = None self._voice_state = {} + self._extra = kwargs or {} def __repr__(self): return (