Deleted mysql support, redis password, webhook, keyboard constructors, filters, loguru.

Added support of decorators in handlers
Added function to notify admins on startup
This commit is contained in:
Kostiantyn Kriuchkov
2020-04-14 01:50:57 +03:00
parent 13ff8d0478
commit eab45a5088
30 changed files with 141 additions and 223 deletions

View File

@@ -1,15 +0,0 @@
from typing import List
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
from . import utils
class DefaultConstructor:
@staticmethod
def _create_kb(actions: List[str], schema: List[int]) -> ReplyKeyboardMarkup:
btns = []
for a in actions:
btns.append(KeyboardButton(a))
kb = utils.misc.arrange_default_schema(btns, schema)
return kb

View File

@@ -1 +0,0 @@
from . import misc

View File

@@ -1,17 +0,0 @@
from typing import List
from aiogram.types import ReplyKeyboardMarkup, KeyboardButton
def arrange_default_schema(buttons: List[KeyboardButton], count: List[int]) -> ReplyKeyboardMarkup:
kb = ReplyKeyboardMarkup(resize_keyboard=True)
kb.row_width = max(count)
if sum(count) != len(buttons):
raise ValueError('Количество кнопок не совпадает со схемой')
tmplist = []
for a in count:
tmplist.append([])
for _ in range(a):
tmplist[-1].append(buttons.pop(0))
kb.keyboard = tmplist
return kb