Discord bot with AI not working

Hi, I need help with a miscord bot written in python that uses artificial intelligence. it is a simple bot because it just starts with the project. Unfortunately already at this level something breaks and i can’t understand why. Below i’m posting the code of my bot. When i fire it up everything works fine, but when i try to send any command it doesn’t work or displays that the bandwidth limit has been used up. When i go to the openai website everything is fine and when the bot responds to any command it writes me in the terminal to check my plan. I don’t understand anything. As i wrote earlier i’m posting the code (of course, in places where there should be secret codes in the original code, but there are none in the shared one, due to security reasons):

import discord
from discord.ext import commands
import openai

openai.api_key = 


intents = discord.Intents.all()
bot = commands.Bot(command_prefix='!', intents=intents)

response_cache = {}

async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
        await ctx.send(f'To polecenie jest obecnie na czasie odstępu. Spróbuj ponownie za {error.retry_after:.2f} sekund.')
    elif isinstance(error, commands.MissingRequiredArgument):
        await ctx.send('Brakuje argumentu. Upewnij się, że wprowadziłeś wszystkie wymagane argumenty.')
        await ctx.send(f'Wystąpił błąd: {error}')

async def on_ready():
    print("Bot jest gotowy.")
    channel = bot.get_channel(CHANNEL_ID)
    await channel.send("Cześć, jestem gotowy do działania!")

async def on_message(message):
    if message.author == bot.user:

    prompt = message.content
    if prompt in response_cache:
        reply = response_cache[prompt]
            response = openai.Completion.create(
            reply = response.choices[0].text.strip()
            response_cache[prompt] = reply
        except openai.error.RateLimitError as e:
            await message.channel.send(f'Przekroczono limit przepustowości. Sprawdź swój plan i szczegóły dotyczące faktur.')
        except Exception as e:
            await message.channel.send(f'Wystąpił błąd OpenAI: {e}')

    await message.channel.send(reply)

async def yo(ctx):
    await ctx.send("Cześć!")