Skip to content

Commit 3c08633

Browse files
committed
Hopefully fixes the music player
1 parent d8466ba commit 3c08633

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

teapot/cogs/music.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def connect_to(self, guild_id: int, channel_id: str):
5151
@commands.command(aliases=['p'])
5252
async def play(self, ctx, *, query: str):
5353
""" Searches and plays a song from a given query. """
54-
player = self.bot.lavalink.players.get(ctx.guild.id)
54+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
5555

5656
query = query.strip('<>')
5757

@@ -87,7 +87,7 @@ async def play(self, ctx, *, query: str):
8787
@commands.command()
8888
async def seek(self, ctx, *, seconds: int):
8989
""" Seeks to a given position in a track. """
90-
player = self.bot.lavalink.players.get(ctx.guild.id)
90+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
9191

9292
track_time = player.position + (seconds * 1000)
9393
await player.seek(track_time)
@@ -97,7 +97,7 @@ async def seek(self, ctx, *, seconds: int):
9797
@commands.command(aliases=['forceskip'])
9898
async def skip(self, ctx):
9999
""" Skips the current track. """
100-
player = self.bot.lavalink.players.get(ctx.guild.id)
100+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
101101

102102
if not player.is_playing:
103103
return await ctx.send('Not playing.')
@@ -108,7 +108,7 @@ async def skip(self, ctx):
108108
@commands.command()
109109
async def stop(self, ctx):
110110
""" Stops the player and clears its queue. """
111-
player = self.bot.lavalink.players.get(ctx.guild.id)
111+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
112112

113113
if not player.is_playing:
114114
return await ctx.send('Not playing.')
@@ -120,7 +120,7 @@ async def stop(self, ctx):
120120
@commands.command(aliases=['np', 'n', 'playing'])
121121
async def now(self, ctx):
122122
""" Shows some stats about the currently playing song. """
123-
player = self.bot.lavalink.players.get(ctx.guild.id)
123+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
124124

125125
if not player.current:
126126
return await ctx.send('Nothing playing.')
@@ -139,7 +139,7 @@ async def now(self, ctx):
139139
@commands.command(aliases=['q'])
140140
async def queue(self, ctx, page: int = 1):
141141
""" Shows the player's queue. """
142-
player = self.bot.lavalink.players.get(ctx.guild.id)
142+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
143143

144144
if not player.queue:
145145
return await ctx.send('Nothing queued.')
@@ -162,7 +162,7 @@ async def queue(self, ctx, page: int = 1):
162162
@commands.command(aliases=['resume'])
163163
async def pause(self, ctx):
164164
""" Pauses/Resumes the current track. """
165-
player = self.bot.lavalink.players.get(ctx.guild.id)
165+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
166166

167167
if not player.is_playing:
168168
return await ctx.send('Not playing.')
@@ -177,7 +177,7 @@ async def pause(self, ctx):
177177
@commands.command(aliases=['vol'])
178178
async def volume(self, ctx, volume):
179179
""" Changes the player's volume (0-1000). """
180-
player = self.bot.lavalink.players.get(ctx.guild.id)
180+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
181181

182182
try:
183183
volume = int(volume)
@@ -193,7 +193,7 @@ async def volume(self, ctx, volume):
193193
@commands.command()
194194
async def shuffle(self, ctx):
195195
""" Shuffles the player's queue. """
196-
player = self.bot.lavalink.players.get(ctx.guild.id)
196+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
197197
if not player.is_playing:
198198
return await ctx.send('Nothing playing.')
199199

@@ -203,7 +203,7 @@ async def shuffle(self, ctx):
203203
@commands.command(aliases=['loop', 'l'])
204204
async def repeat(self, ctx):
205205
""" Repeats the current song until the command is invoked again. """
206-
player = self.bot.lavalink.players.get(ctx.guild.id)
206+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
207207

208208
if not player.is_playing:
209209
return await ctx.send('Nothing playing.')
@@ -214,7 +214,7 @@ async def repeat(self, ctx):
214214
@commands.command()
215215
async def remove(self, ctx, index: int):
216216
""" Removes an item from the player's queue with the given index. """
217-
player = self.bot.lavalink.players.get(ctx.guild.id)
217+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
218218

219219
if not player.queue:
220220
return await ctx.send('Nothing queued.')
@@ -229,7 +229,7 @@ async def remove(self, ctx, index: int):
229229
@commands.command()
230230
async def find(self, ctx, *, query):
231231
""" Lists the first 10 search results from a given query. """
232-
player = self.bot.lavalink.players.get(ctx.guild.id)
232+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
233233

234234
if not query.startswith('ytsearch:') and not query.startswith('scsearch:'):
235235
query = 'ytsearch:' + query
@@ -253,7 +253,7 @@ async def find(self, ctx, *, query):
253253
@commands.command(aliases=['dc'])
254254
async def disconnect(self, ctx):
255255
""" Disconnects the player from the voice channel and clears its queue. """
256-
player = self.bot.lavalink.players.get(ctx.guild.id)
256+
player = self.bot.lavalink.player_manager.get(ctx.guild.id)
257257

258258
if not player.is_connected:
259259
return await ctx.send('Not connected.')

0 commit comments

Comments
 (0)