import openai
from aiogram import Bot, types
from aiogram.dispatcher import Dispatcher
from aiogram.utils import executor
telegram_token = "Token_Telegram"
openai.api_key = "Api_Key_ChatGPT"
bot = Bot(telegram_token)
dp = Dispatcher()
@dp.message_handler()
async def send(message: types.Message):
response = openai.Completion.create(
model="text-davinci-003",
prompt=message.text,
temperature=0.9,
max_tokens=2000,
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.6,
)
await message.answer(response['choices'][0]['text'])
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)
Выдает ошибку
@dp.message_handler()
^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable