@client.command(description="Pauses the current playing track. Can be resumed with `!resume`.",
brief="Pauses current track.",aliases=['PAUSE'])
async def pause(ctx):
guild_id = ctx.message.guild.id
players[guild_id].pause()
@client.command(description="Resumes the current playing track. Can only be used if current track has
been paused.",
brief="Resumes current track.",
aliases=['RESUME','continue','CONTINUE'])
async def resume(ctx):
guild_id = ctx.message.guild.id
players[guild_id].resume()
@client.command(description="Stops the current playing track.",
brief="Stops current track.",
aliases=['STOP'])
async def stop(ctx):
guild_id = ctx.message.guild.id
players[guild_id].stop()
When i try to use the pause, stop and resume command it gives me the KeyError. The whole code that triggers that error is up there. And the error lokks like this:
Ignoring exception in command stop: Traceback (most recent call last): File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 83, in wrapped ret = await coro(*args, **kwargs) File "C:/Users/emirs/PycharmProjects/discordmasterbot/MASTERBOT.py", line 163, in stop players[guild_id].stop() KeyError: 708748879079932016
And there is an another type of that error:
Traceback (most recent call last): File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\bot.py", line 892, in invoke await ctx.command.invoke(ctx) File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 797, in invoke await injected(*ctx.args, **ctx.kwargs) File "C:\Users\emirs\PycharmProjects\discordmasterbot\venv\lib\site-packages\discord\ext\commands\core.py", line 92, in wrapped raise CommandInvokeError(exc) from exc discord.ext.commands.errors.CommandInvokeError: Command raised an exception: KeyError: 708748879079932016
players
? – Patrick Haugh