I'm building a bot with discord.py and i have encountered a problem with lambda and async. In particular i don't know how to fit a "Async lambda", if it possible, in the play function. This is the actual code:
async def play(...):
...
voice.play(discord.FFmpegOpusAudio(source=self.song_path),
after=lambda e: self.play_next(ctx))
async def play_next(...):
...
vc.play(discord.FFmpegPCMAudio(
source=self.song_path),
after=lambda e: self.play_next(ctx))
await ctx.send(embed=Utility.get_embed("Now Playing", self.song_queue))
And this is the problem
coroutine 'main_bot.play_next' was never awaited self.after(error) RuntimeWarning: Enable tracemalloc to get the object allocation traceback*