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(player): set blank filter if no filters enabled #51

Merged
merged 2 commits into from
Feb 17, 2023

Conversation

ooliver1
Copy link
Owner

Summary

Set a blank filter if no filters are applied and are updated.

https://canary.discord.com/channels/864563184919773226/1076074968087011409/1076074968087011409

17.02.2023 11:26:46 | INFO | Cattosarus#0463 ran application command "bassboost"
Ignoring exception in command <nextcord.application_command.SlashApplicationCommand object at 0x00000140A183F700>:
Traceback (most recent call last):
  File "C:\Users\Cattosarus\AppData\Local\Programs\Python\Python39\lib\site-packages\nextcord\application_command.py", line 863, in invoke_callback_with_hooks
    await self(interaction, *args, **kwargs)
  File "c:\Users\Cattosarus\Desktop\mafic-bot\cogs\music.py", line 258, in bassboost
    await player.remove_filter("bassboost")
  File "C:\Users\Cattosarus\AppData\Local\Programs\Python\Python39\lib\site-packages\mafic\player.py", line 689, in remove_filter
    await self._update_filters(fast_apply=fast_apply)
  File "C:\Users\Cattosarus\AppData\Local\Programs\Python\Python39\lib\site-packages\mafic\player.py", line 635, in _update_filters
    await self.update(filter=reduce(or_, self._filters.values()))
TypeError: reduce() of empty sequence with no initial value

The above exception was the direct cause of the following exception:

nextcord.errors.ApplicationInvokeError: Command raised an exception: TypeError: reduce() of empty sequence with no initial value

Checklist

  • If code changes were made then they have been tested.
  • I have run task lint to format code and my changes.
  • I have run task pyright and fixed the relevant issues.

@ooliver1 ooliver1 added t: bug Type: bug - something isn't working p: high Priority: high - should be worked on as soon as reasonable labels Feb 17, 2023
@ooliver1 ooliver1 merged commit 8ccf60e into master Feb 17, 2023
@ooliver1 ooliver1 deleted the fix/filter-remove branch February 17, 2023 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: high Priority: high - should be worked on as soon as reasonable t: bug Type: bug - something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant