+ Telegram bot: sign up, sign in, notifications + Anonymous users can't see yuan_rate_commission * Only logged in customers can create/update orders * Customer info migrated to separate User model * Renamed legacy fields in serializers * Cleanup in API classes
15 lines
307 B
Python
15 lines
307 B
Python
from celery import shared_task
|
|
|
|
|
|
@shared_task
|
|
def send_tg_message(user_id, message, **kwargs):
|
|
from tg_bot.bot import bot_sync as bot
|
|
|
|
if user_id is None:
|
|
return
|
|
|
|
if 'state' in kwargs:
|
|
bot.set_state(user_id, kwargs.pop('state'))
|
|
|
|
bot.send_message(user_id, message, **kwargs)
|