Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix post-dinkster issues #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def __call__(self, *_args):
if len(self.stack) > 0:
after = self.stack.pop()
self.voice_client.play(self.source, after=after)
else:
self.after_callback()


class MusicBot:
Expand Down Expand Up @@ -460,7 +462,7 @@ def get_spotify_client(self):
return None
return spotipy.Spotify(auth_manager=creds)

def after_callback(self, _):
def after_callback(self, *_args):
"""
Plays the next item in queue if after_callback_blocked == False, otherwise stops
the music. Used as a callback for play().
Expand Down Expand Up @@ -914,6 +916,9 @@ async def show_current(self, message, _command_content):
if self.current_media is None and len(self.media_deque) == 0:
await message.channel.send(":sparkles: Nothing in queue")
return
if self.current_media is None:
await message.channel.send(":notes: Current song is paused :play_pause:")
return

reply = ""
reply += ":notes: Now playing :notes:\n"
Expand Down Expand Up @@ -1017,7 +1022,7 @@ async def interrupt_play(self, message, source):
"""
voice_client = await self.create_or_get_voice_client(message)
if not voice_client:
return
return False

current_source = voice_client.source
voice_client.pause()
Expand Down