just use asyncio.wait_for
@@ -131,7 +131,7 @@ class Minecraft(commands.Cog):
async def mc_ping(self, ctx, server: str, port: int = None):
async with ctx.typing():
try:
- status = await self.bot.loop.wait_for(self.unified_mc_ping(server, port), timeout=7)
+ status = await asyncio.wait_for(self.unified_mc_ping(server, port), timeout=7, loop=self.bot.loop)
except asyncio.TimeoutError:
await ctx.send(embed=discord.Embed(color=discord.Color.greeN(),
description="Oops, something went wrong, try again later!"))
