From c75cdc60bcc03bac85d8921accff9f583a362e3f Mon Sep 17 00:00:00 2001 From: SCARTAL <114094147+SCARTAL@users.noreply.github.com> Date: Fri, 21 Apr 2023 17:54:21 +0330 Subject: [PATCH] Unnecessary async function `is_privileged()` function does not contain any asynchronous code therefore being an async function does not effect performance. And it's been called across the code without the `await` keyword causing `RuntimeWarning: coroutine 'Music.is_privileged' was never awaited` error. --- examples/advanced.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/advanced.py b/examples/advanced.py index 86febff..d16bba5 100644 --- a/examples/advanced.py +++ b/examples/advanced.py @@ -101,7 +101,7 @@ class Music(commands.Cog): await self.pomice.create_node( bot=self.bot, host="127.0.0.1", - port=3030, + port="3030", password="youshallnotpass", identifier="MAIN", ) @@ -119,7 +119,7 @@ class Music(commands.Cog): return required - async def is_privileged(self, ctx: commands.Context): + def is_privileged(self, ctx: commands.Context): """Check whether the user is an Admin or DJ.""" player: Player = ctx.voice_client