Skip to content

Different queue for each voice channel#42

Merged
Wikijito7 merged 4 commits into
Wikijito7:mainfrom
javdc:multi_queue
Mar 27, 2024
Merged

Different queue for each voice channel#42
Wikijito7 merged 4 commits into
Wikijito7:mainfrom
javdc:multi_queue

Conversation

@javdc
Copy link
Copy Markdown
Contributor

@javdc javdc commented Mar 13, 2024

Now each guild (server) has its very own sound queue, and multiple guilds can listen to the bot simultaneously.

@javdc javdc marked this pull request as ready for review March 13, 2024 17:43
@Wikijito7 Wikijito7 self-requested a review March 13, 2024 17:52
Comment thread guild_queue.py
Comment thread main.py
@javdc javdc requested a review from Wikijito7 March 13, 2024 20:23
Copy link
Copy Markdown
Owner

@Wikijito7 Wikijito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for new tests in dev execution between servers to merge.

@Wikijito7
Copy link
Copy Markdown
Owner

Wikijito7 commented Mar 14, 2024

Crash after adding a lot of sounds to queue and then leaving without finishing it to add them while being connected on voice channel.

ERROR:root:on_command_error >> Exception caught when running command
Traceback (most recent call last):
  File "/home/wokis/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/wokis/ecibot-dev/main.py", line 259, in youtube
    await add_to_queue(ctx.guild.id, ctx.author.voice.channel, ctx.channel, sound)
AttributeError: 'NoneType' object has no attribute 'channel'

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

Traceback (most recent call last):
  File "/home/wokis/.local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
    await ctx.command.invoke(ctx)
  File "/home/wokis/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 1029, in invoke
    await injected(*ctx.args, **ctx.kwargs)  # type: ignore
  File "/home/wokis/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 244, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'channel'
ERROR:root:on_command_error >> Exception caught when running command
Traceback (most recent call last):
  File "/home/wokis/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 235, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/wokis/ecibot-dev/main.py", line 259, in youtube
    await add_to_queue(ctx.guild.id, ctx.author.voice.channel, ctx.channel, sound)
AttributeError: 'NoneType' object has no attribute 'channel'

@Wikijito7
Copy link
Copy Markdown
Owner

Wikijito7 commented Mar 14, 2024

When adding a new video, it may block the thread enough time to execute skip and make the bot disconnect with sounds on the queue as it is marked as ready to be removed but there are content on the queue.

We should double check if the bot was marked as ready to remove but there are content (that may happen) and remove this state in order to mantain it playing.

# Conflicts:
#	voice.py
@Wikijito7
Copy link
Copy Markdown
Owner

This branch will be merged to solve errors from main branch.

@Wikijito7 Wikijito7 merged commit a90f286 into Wikijito7:main Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants