This commit is contained in:
Pavel_Durov 2024-05-10 19:46:37 +03:00
parent a571709afa
commit db842a1ceb
2 changed files with 28 additions and 26 deletions

View File

@ -12,7 +12,8 @@ telegram_admins_ids:
- 317051301 # hogweed1
- 226765676 # blackjack
- 94830892 # viktorRMI
- 132002803
openai:
token: 5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc
api_key: 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 ## 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
api_key: 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 ## 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

View File

@ -3,7 +3,7 @@ from aiogram import types
from create_bot import dp, bot
import logging
from global_conf import CONFIG
admins = CONFIG['telegram_admins_ids']
token = CONFIG['openai']['token']
@ -16,6 +16,7 @@ ban_comands = ['/dick','/topdick']
@dp.message_handler(commands=['image'])
async def send_image(message: types.Message):
if message.from_user.id in admins and message.chat.type == 'private':
try:
description = message.text.replace('/image', '').strip()
@ -41,11 +42,11 @@ async def send_image(message: types.Message):
@dp.message_handler()
async def send(message: types.Message):
if message.text.lower().startswith('тупица'):
if message.from_user.id in admins and message.chat.type == 'private':
## TODO уточнить остатки токенов и денег
response = openai.Completion.create(
model="text-davinci-003",
model="gpt-4-turbo",
prompt=message.text[7:],
temperature=0.7,
max_tokens=1000,
@ -58,7 +59,7 @@ async def send(message: types.Message):
elif message.reply_to_message.from_user.is_bot:
response = openai.Completion.create(
model="text-davinci-003",
model="gpt-4-turbo",
prompt=message.text,
temperature=0.7,
max_tokens=1000,