#8 надеюсь не сломается
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:
parent
b188edd98d
commit
ef4c806071
6
bot.py
6
bot.py
@ -1,9 +1,9 @@
|
||||
import logging
|
||||
from aiogram import executor
|
||||
from aiogram import executor, Bot, Dispatcher
|
||||
from create_bot import dp
|
||||
import handlers
|
||||
import json
|
||||
|
||||
from global_conf import CONFIG
|
||||
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ logging.getLogger("aiogram").addFilter(filter_grammar_messages)
|
||||
# start_help.register_handlers_StartHelp(dp)
|
||||
|
||||
if __name__ == '__main__':
|
||||
#print(CONFIG)
|
||||
|
||||
executor.start_polling(dp, skip_updates=True)
|
||||
|
||||
|
||||
|
17
config.yaml
Normal file
17
config.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
databaso:
|
||||
host: 'https://arango.guaranteedstruggle.host'
|
||||
user: root
|
||||
pass: stolendick527
|
||||
base: pipisa
|
||||
collection: dicks
|
||||
|
||||
telegram_token: 5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w
|
||||
telegram_admins_ids:
|
||||
- 317051301 # hogweed1
|
||||
- 226765676 # blackjack
|
||||
- 94830892 # viktorRMI
|
||||
|
||||
openai:
|
||||
token: 5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc
|
||||
api_key: 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 ## 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
|
@ -1,7 +1,8 @@
|
||||
from aiogram import Bot, Dispatcher
|
||||
from global_conf import CONFIG
|
||||
|
||||
|
||||
API_TOKEN = '5724991559:AAEuLvpLsgP6LHRGMSyFtQLlR5qPQUO4b_w'
|
||||
API_TOKEN = '6472915685:AAHPvgrQoqG7DxtfbnHWPe3Lfild-CGJ1j8'
|
||||
|
||||
bot = Bot(token=API_TOKEN, parse_mode="HTML")
|
||||
bot = Bot(token=CONFIG['telegram_token'], parse_mode="HTML")
|
||||
dp = Dispatcher(bot)
|
6
global_conf.py
Normal file
6
global_conf.py
Normal file
@ -0,0 +1,6 @@
|
||||
import yaml
|
||||
|
||||
|
||||
|
||||
with open("config.yaml", 'r') as f:
|
||||
CONFIG = yaml.load(f, Loader=yaml.Loader)
|
@ -3,6 +3,4 @@ from handlers import pipisa
|
||||
from handlers import start_help
|
||||
|
||||
from handlers import time_new_year
|
||||
from handlers import sendalarm
|
||||
#from handlers import davinci
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
import openai
|
||||
from aiogram import types, Dispatcher
|
||||
from aiogram import types
|
||||
from create_bot import dp, bot
|
||||
import logging
|
||||
from global_conf import CONFIG
|
||||
|
||||
|
||||
|
||||
token = '5947963644:AAF_GKgMmU5ovqMpc1KXIpcf4aN0JMyKPqc'
|
||||
#openai.api_key = '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'
|
||||
openai.api_key = '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'
|
||||
token = CONFIG['openai']['token']
|
||||
openai.api_key = CONFIG['openai']['api_key']
|
||||
ban_comands = ['/dick','/topdick']
|
||||
|
||||
# Image_promt =['тупица сгенерируй','тупица сгенерируй картинку',\
|
||||
|
@ -1,17 +1,17 @@
|
||||
from aiogram import types, Dispatcher
|
||||
from aiogram import types
|
||||
from create_bot import bot, dp
|
||||
#from sqdb import user, session
|
||||
import random
|
||||
from random import randint
|
||||
import datetime
|
||||
from dicktxt import ForReadDict
|
||||
from pipisa_functions import pipisa_time
|
||||
|
||||
from global_conf import CONFIG
|
||||
|
||||
#### https://docs.python-arango.com/en/main/
|
||||
from arango import ArangoClient
|
||||
|
||||
admins = [317051301, 226765676]
|
||||
admins = CONFIG['telegram_admins_ids']
|
||||
|
||||
|
||||
@dp.message_handler(commands=["dick"])
|
||||
@ -21,9 +21,13 @@ async def up_dick(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')
|
||||
dicks_collection = pipisa_db.collection('dicks')
|
||||
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
||||
pipisa_db = arango_client.db(
|
||||
CONFIG['databaso']['base'],
|
||||
username=CONFIG['databaso']['user'],
|
||||
password=CONFIG['databaso']['pass']
|
||||
)
|
||||
dicks_collection = pipisa_db.collection(CONFIG['databaso']['collection'])
|
||||
|
||||
|
||||
#### TODO уплатить нолог с 100 см для самого нищего
|
||||
@ -171,9 +175,13 @@ async def up_dick(message: types.Message):
|
||||
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')
|
||||
dicks_collection = pipisa_db.collection('dicks')
|
||||
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
||||
pipisa_db = arango_client.db(
|
||||
CONFIG['databaso']['base'],
|
||||
username=CONFIG['databaso']['user'],
|
||||
password=CONFIG['databaso']['pass']
|
||||
)
|
||||
dicks_collection = pipisa_db.collection(CONFIG['databaso']['collection'])
|
||||
|
||||
try:
|
||||
dicks = dicks_collection.find({'chat_id': message.chat.id}, skip=0, limit=1100)
|
||||
@ -209,9 +217,13 @@ async def send_topchat(message: types.Message):
|
||||
async def send_global_top(message: types.Message):
|
||||
|
||||
|
||||
arango_client = ArangoClient(hosts='https://arango.guaranteedstruggle.host')
|
||||
pipisa_db = arango_client.db('pipisa', username='root', password='stolendick527')
|
||||
dicks_collection = pipisa_db.collection('dicks')
|
||||
arango_client = ArangoClient(hosts=CONFIG['databaso']['host'] )
|
||||
pipisa_db = arango_client.db(
|
||||
CONFIG['databaso']['base'],
|
||||
username=CONFIG['databaso']['user'],
|
||||
password=CONFIG['databaso']['pass']
|
||||
)
|
||||
dicks_collection = pipisa_db.collection(CONFIG['databaso']['collection'])
|
||||
|
||||
try:
|
||||
dicks = dicks_collection.all( )
|
||||
|
@ -1,24 +0,0 @@
|
||||
|
||||
from create_bot import dp, bot
|
||||
from aiogram import types, Dispatcher
|
||||
|
||||
@dp.message_handler(commands=['sendall'])
|
||||
async def sendall(message: types.Message):
|
||||
print('команда прошла')
|
||||
if message.chat.type == 'private':
|
||||
if message.from_user.id == 226765676:
|
||||
text = message.text[9:]
|
||||
try:
|
||||
chats_id = -1001355646177
|
||||
|
||||
try:
|
||||
await bot.send_message(chats_id, text)
|
||||
except:
|
||||
print('вероятно бота нет в чате')
|
||||
await bot.send_message(message.from_user.id, 'Сообщение успешно отправлено во все чаты')
|
||||
except:
|
||||
print('eror sendall')
|
||||
|
||||
|
||||
# def register_handlers_test(dp: Dispatcher):
|
||||
# dp.register_message_handler(send_welcome)
|
@ -1,4 +1,4 @@
|
||||
from aiogram import types, Dispatcher
|
||||
from aiogram import types
|
||||
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
||||
from create_bot import dp, bot
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
aiogram
|
||||
python-arango
|
||||
pyyaml
|
Loading…
Reference in New Issue
Block a user