23 lines
748 B
Python
23 lines
748 B
Python
from bot.Handler import Handler
|
|
from bot import FIRST
|
|
from telegram.constants import ParseMode
|
|
from ai_bot.states.MidjourneyStates import MIDJOURNEY_SET_PROMPT
|
|
from telegram.ext import MessageHandler, filters, CallbackQueryHandler
|
|
|
|
|
|
class MidjourneyHandler(Handler):
|
|
|
|
@staticmethod
|
|
async def set_prompt(update, context):
|
|
await context.bot.send_message(chat_id=update.effective_chat.id, text="Запрос к Midjourney принят",
|
|
parse_mode=ParseMode.HTML)
|
|
|
|
return FIRST
|
|
|
|
@staticmethod
|
|
def get_states(data=None) -> dict:
|
|
return {
|
|
MIDJOURNEY_SET_PROMPT: [
|
|
MessageHandler(filters.TEXT, MidjourneyHandler.set_prompt)
|
|
]
|
|
} |