Skip to content

[BUG]: Map music_queue and other player properties to ctx.guild.id #21

@code-chaser

Description

@code-chaser

PROBLEM:

  • Currently the bot is using a single music_queue and other player properties over different servers. Since, in discord.py, for all different servers in which the bot is present, only one instance of bot is used, only one, thus, in our case, if the bot is playing music on two different servers, it'll be maintaining a single queue and a single set of player properties for both.
  • For example, changing volume in one server changes it for all the other servers as well.

POSSIBLE WORKAROUND:

  • Make a dictionary with ctx.guild.id as it's key and put a dictionary (containing music_queue as a list, all the other player properties) as the corresponding value.
  • FORMAT:

    player_properties = {
        '<guild1_id>' : {'music_queue': [], 'volume': 1, 'current_song_index': 0, ...},
        '<guild2_id>' : {'music_queue': [], 'volume': 1, 'current_song_index': 0, ...},
        '<guild3_id>' : {'music_queue': [], 'volume': 1, 'current_song_index': 0, ...},
        ...
    }

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions