Added usage example of errors_handler
Optimized generation of default/inline keyboard Customizing webhook path has become more flexible Updated aiogram version to 2.7 (BotAPI 4.7)
This commit is contained in:
15
keyboards/default/consts.py
Normal file
15
keyboards/default/consts.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user