PR #10 (Crussader/main) / Player.__call__

This commit is contained in:
VP 2021-10-20 21:16:41 +03:00 committed by GitHub
commit 70c06fd12f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -29,9 +29,14 @@ class Player(VoiceProtocol):
await ctx.author.voice.channel.connect(cls=pomice.Player) 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): return self
super().__init__(client=client, channel=channel)
def __init__(self, client: ClientType = None, channel: VoiceChannel = None, **kwargs):
# super().__init__(client=client, channel=channel)
self.client = client self.client = client
self._bot = client self._bot = client
@ -51,6 +56,7 @@ class Player(VoiceProtocol):
self._ending_track: Optional[Track] = None self._ending_track: Optional[Track] = None
self._voice_state = {} self._voice_state = {}
self._extra = kwargs or {}
def __repr__(self): def __repr__(self):
return ( return (