def handler(update, context, *args, **kwargs): user, _ = User.get_user_and_created(update, context) action = f"{func.__module__}.{func.__name__}" if not action_name else action_name UserActionLog.objects.create(user_id=user.user_id, action=action, created_at=timezone.now()) return func(update, context, *args, **kwargs)
def command_start(update, context): u, created = User.get_user_and_created(update, context) if created: text = static_text.start_created.format(first_name=u.first_name) else: text = static_text.start_not_created.format(first_name=u.first_name) update.message.reply_text(text=text, reply_markup=make_keyboard_for_start_command())