I saw that you're using psycopg2 for database queries but for async applications like discord.py I'd recommend using asyncpg