3
@commands.command()
async def lyrics(self,ctx,artist, title):
        cs = aiohttp.ClientSession()
        res = await cs.get('https://api.lyrics.ovh/v1/{}/{}'.format(artist,title))
        data = await res.json()
        data = ['lyrics']
        await ctx.send(data)

i get this error.idk what i did wrong.its my first time using aiohttp so im getting a little confused.

client_session: <aiohttp.client.ClientSession object at 0x00000218657B6160>
Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x0000021865678A70>, 379071.609)]']
connector: <aiohttp.connector.TCPConnector object at 0x00000218657B6E10>
Nathan Marotte
  • 771
  • 1
  • 5
  • 15
Alpha
  • 319
  • 2
  • 12

1 Answers1

1

As your traceback says, and as written on this other stackoverflow question, the connector should be closed before the program stops. I assume you get this error at the end of the lifetime of your program. Try using cs.close() just before the program finishes to see if it goes away

Nathan Marotte
  • 771
  • 1
  • 5
  • 15