def maybe_add_event(user_profile_id: int, bot_type: int) -> None:
    if (bot_type == UserProfile.OUTGOING_WEBHOOK_BOT):
        queue_name = 'outgoing_webhooks'
    elif (bot_type == UserProfile.EMBEDDED_BOT):
        queue_name = 'embedded_bots'
    else:
        logging.error('Unexpected bot_type for Service bot id=%s: %s', user_profile_id, bot_type)
        return
    is_stream = (recipient_type == Recipient.STREAM)
    if ((user_profile_id not in mentioned_user_ids) and (user_profile_id not in active_user_ids)):
        return
    if (is_stream and (user_profile_id in mentioned_user_ids)):
        trigger = 'mention'
    elif ((not is_stream) and (user_profile_id in active_user_ids)):
        trigger = 'private_message'
    else:
        return
    event_dict[queue_name].append({'trigger': trigger, 'user_profile_id': user_profile_id})
def maybe_add_event(user_profile_id: int, bot_type: int) -> None:
    if (bot_type == UserProfile.OUTGOING_WEBHOOK_BOT):
        queue_name = 'outgoing_webhooks'
    elif (bot_type == UserProfile.EMBEDDED_BOT):
        queue_name = 'embedded_bots'
    else:
        logging.error('Unexpected bot_type for Service bot id=%s: %s', user_profile_id, bot_type)
        return
    is_stream = (recipient_type == Recipient.STREAM)
    if ((user_profile_id not in mentioned_user_ids) and (user_profile_id not in active_user_ids)):
        return
    if (is_stream and (user_profile_id in mentioned_user_ids)):
        trigger = 'mention'
    elif ((not is_stream) and (user_profile_id in active_user_ids)):
        trigger = 'private_message'
    else:
        return
    event_dict[queue_name].append({'trigger': trigger, 'user_profile_id': user_profile_id})