add mailing function
This commit is contained in:
43
app/bot/dialogs/flows/mailing/dialogs.py
Normal file
43
app/bot/dialogs/flows/mailing/dialogs.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from aiogram_dialog import Dialog, Window
|
||||
from aiogram_dialog.widgets.input import MessageInput
|
||||
from aiogram_dialog.widgets.kbd import Back, Button, Cancel
|
||||
from aiogram_dialog.widgets.text import Const
|
||||
|
||||
# from .getters import event_getter, events_list_getter, registration_getter
|
||||
from .handlers import choose_recipients, confirm_mailing, message_data
|
||||
from .states import MailingSG
|
||||
|
||||
mailing_dialog = Dialog(
|
||||
Window(
|
||||
Const("Пришлите сообщение которое хотите разослать"),
|
||||
MessageInput(message_data),
|
||||
Cancel(Const("Отмена")),
|
||||
state=MailingSG.message_data,
|
||||
),
|
||||
Window(
|
||||
Const("Кому отправить сообщение?"),
|
||||
Button(
|
||||
Const("Всем"),
|
||||
id="send_all",
|
||||
on_click=choose_recipients,
|
||||
),
|
||||
Button(
|
||||
Const("Не админам"),
|
||||
id="send_users",
|
||||
on_click=choose_recipients,
|
||||
),
|
||||
Back(Const("Назад")),
|
||||
state=MailingSG.recipients,
|
||||
),
|
||||
Window(
|
||||
Const("Начать рассылку?"),
|
||||
Button(
|
||||
Const("Разослать"),
|
||||
id="start_mailing",
|
||||
on_click=confirm_mailing,
|
||||
),
|
||||
Back(Const("Назад")),
|
||||
Cancel(Const("Отмена")),
|
||||
state=MailingSG.confirm,
|
||||
),
|
||||
)
|
||||
Reference in New Issue
Block a user