Merge branch 'main' of https://git.guaranteedstruggle.host/Pavel_Durov/python_bot
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
commit
2b7cbb0664
@ -1,7 +1,8 @@
|
||||
|
||||
from handlers import pipisa
|
||||
from handlers import davinci
|
||||
from handlers import time_new_year
|
||||
from handlers import sendalarm
|
||||
from handlers import start_help
|
||||
|
||||
from handlers import time_new_year
|
||||
from handlers import sendalarm
|
||||
from handlers import davinci
|
||||
|
||||
|
@ -3,14 +3,15 @@ from aiogram import types, Dispatcher
|
||||
from create_bot import dp, bot
|
||||
|
||||
|
||||
|
||||
token = '5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc'
|
||||
#openai.api_key = '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'
|
||||
openai.api_key = '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'
|
||||
|
||||
ban_comands = ['/dick','/topdick']
|
||||
|
||||
@dp.message_handler()
|
||||
async def send(message: types.Message):
|
||||
if 'тупица' in message.text.lower():
|
||||
if message.text.lower().startswith('тупица'):
|
||||
|
||||
## TODO уточнить остатки токенов и денег
|
||||
response = openai.Completion.create(
|
||||
@ -25,5 +26,20 @@ async def send(message: types.Message):
|
||||
)
|
||||
await message.reply(response['choices'][0]['text'])
|
||||
|
||||
# elif message.reply_to_message.bot.id:
|
||||
# response = openai.Completion.create(
|
||||
# model="text-davinci-003",
|
||||
# prompt=message.text,
|
||||
# temperature=0.7,
|
||||
# max_tokens=1000,
|
||||
# top_p=1.0,
|
||||
# frequency_penalty=0.0,
|
||||
# presence_penalty=0.6,
|
||||
# stop=["сброс"]
|
||||
# )
|
||||
# await message.reply(response['choices'][0]['text'])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -12,12 +12,15 @@ from pipisa_functions import pipisa_time
|
||||
#### https://docs.python-arango.com/en/main/
|
||||
from arango import ArangoClient
|
||||
|
||||
admins = [317051301, 226765676]
|
||||
|
||||
|
||||
@dp.message_handler(commands=["dick"])
|
||||
async def up_dick(message: types.Message):
|
||||
#global size_change, dick_plus, dick_minus
|
||||
|
||||
if message.from_user.id in admins or message.chat.type != 'private':
|
||||
|
||||
|
||||
arango_client = ArangoClient(hosts='https://arango.guaranteedstruggle.host')
|
||||
pipisa_db = arango_client.db('pipisa', username='root', password='stolendick527')
|
||||
@ -155,13 +158,16 @@ async def up_dick(message: types.Message):
|
||||
except Exception as e:
|
||||
print('ошибка DB в /dick')
|
||||
print(e)
|
||||
else:
|
||||
await message.reply('Растить елду можно только в общих чатах!')
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@dp.message_handler(commands=["topdick"])
|
||||
async def send_topchat(message: types.Message):
|
||||
|
||||
if message.from_user.id in admins or message.chat.type != 'private':
|
||||
|
||||
arango_client = ArangoClient(hosts='https://arango.guaranteedstruggle.host')
|
||||
pipisa_db = arango_client.db('pipisa', username='root', password='stolendick527')
|
||||
@ -190,6 +196,9 @@ async def send_topchat(message: types.Message):
|
||||
i += 1
|
||||
|
||||
await bot.send_message(message.chat.id, '🏆Топ 10 бубылд чата🏆\n\n' + dickos)
|
||||
else:
|
||||
await message.reply('Работает только в общих чатах!\n'\
|
||||
'Вы мсжете посмотреть топ по миру /globaldick')
|
||||
|
||||
|
||||
|
||||
@ -226,3 +235,4 @@ async def send_global_top(message: types.Message):
|
||||
|
||||
await bot.send_message(message.chat.id, '🏆Топ 10 пипис в мире🏆\n\n' + dickos)
|
||||
|
||||
|
||||
|
@ -1,22 +1,27 @@
|
||||
from aiogram import types, Dispatcher
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from create_bot import dp, bot
|
||||
|
||||
@dp.message_handler(commands=['start'])
|
||||
async def start_func(message: types.Message):
|
||||
await message.reply('похуй')
|
||||
if message.chat.type == 'private':
|
||||
|
||||
lkb = InlineKeyboardMarkup(row_width=1).add(InlineKeyboardButton(text = 'Добавить в группу', callback_data='add_2_group'))
|
||||
|
||||
await message.answer(f'<b>Добро пожаловать, {message.from_user.full_name}!</b>\n'
|
||||
'Это бот, который растит члены. Чтобы начать, добавь бота в чат'\
|
||||
, reply_markup=lkb
|
||||
|
||||
)
|
||||
# TODO добавить кнопку, по которой смогут добавлять юзера в чат
|
||||
|
||||
@dp.callback_query_handler(text = 'add_2_group')
|
||||
async def addgroup(callback: types.CallbackQuery):
|
||||
await callback.answer('жмав')
|
||||
|
||||
|
||||
|
||||
|
||||
@dp.message_handler(commands=['photo'])
|
||||
async def send_image(message: types.Message):
|
||||
await bot.send_photo(message.chat.id, photo='https://memepedia.ru/wp-content/uploads/2018/08/ya-pidoras.jpg', reply_to_message_id=message.message_id)
|
||||
|
||||
@dp.message_handler(content_types=types.ContentTypes.TEXT)
|
||||
async def send_faggot(message: types.Message):
|
||||
print(message.text)
|
||||
if message.text == 'хто я':
|
||||
await bot.send_photo(message.chat.id, photo='https://www.meme-arsenal.com/memes/ecebd2339c7eab40e09874bd86a38a09.jpg')
|
||||
|
||||
|
||||
def register_handlers_StartHelp(dp: Dispatcher):
|
||||
dp.register_message_handler(start_func)
|
||||
dp.register_message_handler(send_faggot)
|
||||
dp.register_message_handler(send_image)
|
Loading…
Reference in New Issue
Block a user