mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 22:57:48 +00:00
Merge remote-tracking branch 'upstream/dev-2' into improved-track-embed
This commit is contained in:
+10
-7
@@ -33,13 +33,16 @@ class MusicCog(BaseCog, name="Music"):
|
||||
|
||||
redis_result = await self.bot.global_autojoin.fetch_channels()
|
||||
for guild_id, (voicechannel_id, textchannel_id) in redis_result.items():
|
||||
player = self.bot.lavalink.player_manager.create(guild_id)
|
||||
player.store("channel", textchannel_id)
|
||||
voice_channel = await self.bot.fetch_channel(voicechannel_id)
|
||||
await voice_channel.connect(cls=LavalinkVoiceClient)
|
||||
if not player.is_playing:
|
||||
await helper.fill_player_queue(self.bot, player, QUEUE_SIZE)
|
||||
await player.play()
|
||||
try:
|
||||
player = self.bot.lavalink.player_manager.create(guild_id)
|
||||
player.store("channel", textchannel_id)
|
||||
voice_channel = await self.bot.fetch_channel(voicechannel_id)
|
||||
await voice_channel.connect(cls=LavalinkVoiceClient)
|
||||
if not player.is_playing:
|
||||
await helper.fill_player_queue(self.bot, player, QUEUE_SIZE)
|
||||
await player.play()
|
||||
except:
|
||||
logger.error(f"Failed to autojoin guild {guild_id}.")
|
||||
|
||||
async def track_hook(self, event: lavalink.Event):
|
||||
if isinstance(event, lavalink.events.QueueEndEvent):
|
||||
|
||||
Reference in New Issue
Block a user