DATA - полезная нагрузка. которую несет кнопка (например, выбранный язык или айдишник задачи, на которую ткнули)
COMMAND - старая добрая команда. если коллбек кнопки предполагает показ задачи, то командой будет CommandType.View.value. Обрабатываться такой коллбек будет в стейте, который как и раньше, будет выбран автоматом на основании текущего стейта и этой самой команды. Другими словами COMMAND - это способ выбрать стейт из коллбека.
ACTION - это некоторое расширение стейта. то есть можно показать в стейте все таски. тогда нужен Action.LIST_ALL. а можно показать только выполненные. тогда нужен Action.LIST_COMPLETED.
interaction_handler доработан с учетом коллбеков кнопок. общая схема взаимодействия с ним не изменилась.
чтобы реализовать сейчас какой-то стейт, на который можно перейти по кнопке, нужно:
реализовать стейт в обычном виде (как будто туда приходит прсто команда)
реализовать обработку Action'ов в стейте, на случай, если в стейт перешли из коллбека кнопки.
если это нужно, то наполнить стейт информацией из Data
добавлены эмодзи
P.S. как выглядят блоки кнопок можно увидеть в components/keyboard_builder.py
P.S. проверка пересечения с другими уведолмения работает некорректно. будет исправлена позднее
самое масштабное обновление
добавлено сохранение уведомлений. тпереь при рестарте бота засетанные уведомления не теряются
добавлены кнопки на некторые стейты. стейты, что по-прежнему надо вызывать вручную -
all
(/all),date
(/date),lang
(/lang).добавлен "шаблонизатор" кнопок, который по входным данным типа таких:
сформирует такой набор кнопок:
кнопка описывается структурой:
в этой стрктуре:
LABEL
-надпись.DATA
- полезная нагрузка. которую несет кнопка (например, выбранный язык или айдишник задачи, на которую ткнули)COMMAND
- старая добрая команда. если коллбек кнопки предполагает показ задачи, то командой будетCommandType.View.value
. Обрабатываться такой коллбек будет в стейте, который как и раньше, будет выбран автоматом на основании текущего стейта и этой самой команды. Другими словамиCOMMAND
- это способ выбрать стейт из коллбека.ACTION
- это некоторое расширение стейта. то есть можно показать в стейте все таски. тогда нуженAction.LIST_ALL
. а можно показать только выполненные. тогда нуженAction.LIST_COMPLETED
.interaction_handler
доработан с учетом коллбеков кнопок. общая схема взаимодействия с ним не изменилась.чтобы реализовать сейчас какой-то стейт, на который можно перейти по кнопке, нужно:
Action
'ов в стейте, на случай, если в стейт перешли из коллбека кнопки.Data
добавлены эмодзи
P.S. как выглядят блоки кнопок можно увидеть в
components/keyboard_builder.py
P.S. проверка пересечения с другими уведолмения работает некорректно. будет исправлена позднее