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

پارامترهای ارسالی به توابع در مثال ها #22

Closed
VahidGh opened this issue May 14, 2018 · 1 comment
Closed

Comments

@VahidGh
Copy link

VahidGh commented May 14, 2018

سلام

اگر امکانش هست مثال کاملتری از نحوه صدا زدن متدها در مثال های فعلی و ارسال پارامترها به این متدها گذاشته شود.
برای نمونه در مثال زیر:
https://github.com/balemessenger/bale-bot-samples/blob/master/examples/text_conversion.py#L33
نحوه فراخوانی تابع و پارامترهای ارسالی در مثال مشخص نیست.
مخصوصا پارامتر
update
که در مثال نحوه ایجاد و ارسال این پارامتر ذکر نشده است.

@EhsanSaZ
Copy link

متد ها به کمک
dispatcher
. و به طور خودکار هنگامی که بات پیامی دریافت بکند فراخوانی می شوند
در رابطه با اینکه در هر استیت
dispatcher
چه تابعی را فراخوانی کند هم به این صورت است که به کمک متد
register_conversation_next_step_handler
که از متد های
dispatcher
است می توان مشخص کرد که بات در یک استیت خاص چه تابعی را اجرا کند.
مانند کد زیر:

dispatcher.register_conversation_next_step_handler(update, MessageHandler(TextFilter(), finish_conversion))

پارامتر های ارسالی هر تابع را نیز خود
dispatcher
به آن توابع ارسال می کند.

@VahidGh VahidGh closed this as completed May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants