Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start dialog if i have only user/chat id #263

Open
j0ker opened this issue May 19, 2023 · 1 comment
Open

Start dialog if i have only user/chat id #263

j0ker opened this issue May 19, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@j0ker
Copy link

j0ker commented May 19, 2023

Добрый день, вот такая история:
Есть сайт, на котором регистрируются пользователи через виджет телеграма, у пользователя есть некий профиль, он заполняется в автоматическом режиме. Как только профиль заполнен, нужно отправить оповещение пользователю (начать диалог) в телеге.
Из входных данных имеется user / chat id и инстанс бота.

Полагаю, что нужно сделать:
bot.send_message(user_id, ...)
Но не понимаю как сюда диалог приспособить.

Подскажите пожалуйста как стартануть диалог?

Спасибо


Hello,
how start dialog with user if i have only user id?
Need send notification in telegram after update information about user on site.

Thanks

@j0ker j0ker changed the title Старт диалога имея только user/chat id Start dialog if i have only user/chat id May 19, 2023
@j0ker
Copy link
Author

j0ker commented May 20, 2023

Сделал так:

from aiogram_dialog.manager.bg_manager import BgManager
from aiogram.types import Chat, User
from aiogram_dialog import StartMode, ShowMode
from app.states import MainSG

...

user = User(id=<telegram_id>, is_bot=False, first_name="First name")
chat = Chat(id=<telegram_id>, type="private")
manager = BgManager(user=user, chat=chat, bot=<bot>, router=<router>, intent_id=None, stack_id="")

await manager.start(MainSG.start, mode=StartMode.RESET_STACK, show_mode=ShowMode.SEND)

@Tishka17 Tishka17 added the documentation Improvements or additions to documentation label Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants