איך אוספים ומנהלים אנשי קשר ב-Google Chat

במדריך הזה מוסבר איך לפתח אפליקציה של Google Chat שעוזרת המשתמשים ב-Google Chat מנהלים את אנשי הקשר האישיים והעסקיים שלהם. לאיסוף מידע, אפליקציית Chat מציעה למשתמשים טופס ליצירת קשר בהודעות ובתיבות הדו-שיח של הכרטיסים.

איך רואים את אפליקציית Chat בפעולה?

  • טופס ליצירת קשר דרך פקודה של שורת הפקודות.
    איור 1. אפליקציית Chat מגיבה הפקודה /about עם הודעת טקסט ולחצן ייפתח טופס ליצירת קשר.
  • טופס ליצירת קשר בתיבת דו-שיח.
    איור 2. אפליקציית Chat פותחת תיבת דו-שיח שבה המשתמשים יכולים להזין את הפרטים של איש הקשר.
  • תיבת דו-שיח לאישור ובדיקה.
    איור 3. אפליקציית Chat מחזירה תיבת דו-שיח לאישור, שהמשתמשים יכולים לבדוק ולאשר את המידע לפני בתהליך הגשה.
  • הודעת טקסט שמאשרת את איש הקשר החדש.
    איור 4. אחרי שהמשתמש שולח את הטופס, אפליקציית Chat שולחת לו הודעת טקסט לאישור השליחה.
  • טופס ליצירת קשר מהודעה בכרטיס.
    איור 5. באפליקציית Chat המשתמשים גם מתבקשים להוסיף איש קשר מכרטיס בהודעה.

דרישות מוקדמות

מטרות

ארכיטקטורה

אפליקציית Chat מובנית Google Apps Script ומשתמש בו אירועי אינטראקציה לעיבוד ולענות למשתמשים ב-Chat.

הדוגמה הבאה מראה איך משתמש בדרך כלל מקיים אינטראקציה עם אפליקציית Chat:

  1. משתמש פותח צ'אט אישי באמצעות אפליקציית Chat, או מוסיף את אפליקציית Chat למרחב משותף קיים.

  2. אפליקציית Chat מבקשת מהמשתמש להוסיף איש קשר באמצעות והם מציגים טופס ליצירת קשר card לאובייקט. כדי להציג את הטופס ליצירת קשר, צריך להשתמש באפליקציית Chat מגיב למשתמשים בדרכים הבאות:

    • להשיב לאזכורים באמצעות @ולצ'אטים אישיים עם הודעה בכרטיס מכיל את הטופס ליצירת קשר.
    • התגובה לפקודת הקו /addContact היא פתיחת תיבת דו-שיח עם טופס יצירת הקשר.
    • תגובה לפקודה /about באמצעות הודעת טקסט עם הלחצן Add a contact (הוספת איש קשר) שהמשתמשים יכולים ללחוץ עליו כדי לפתוח תיבת דו-שיח עם טופס ליצירת קשר.
  3. כשהמשתמש רואה את טופס יצירת הקשר, הוא מזין את פרטי הקשר בשדות ובווידג'טים הבאים:

    • שם פרטי ושם משפחה: textInput לווידג'ט הזה שמקבל מחרוזות.
    • Birthdate (תאריך לידה:) dateTimePicker הווידג'ט שמקבל תאריכים בלבד.
    • סוג איש הקשר: ווידג'ט של selectionInput לחצני בחירה שמאפשר למשתמשים לבחור ולשלוח ערך מחרוזת יחיד (Personal או Work).
    • הלחצן בדיקה ושליחה: buttonList מערך עם הווידג'ט button שהמשתמש לוחץ עליו כדי לשלוח את הערכים שהם מזינים.
  4. אפליקציית Google Chat מטפלת באירוע אינטראקציה מסוג CARD_CLICKED כדי לעבד את הערכים שהמשתמש מזין, ומציגה את הערכים בכרטיס אישור.

  5. המשתמש בודק את כרטיס האישור ולוחץ על הלחצן שליחה. כדי להשלים את הפרטים ליצירת קשר.

  6. אפליקציית Google Chat שולחת הודעת טקסט פרטית מאשר את ההגשה.

מכינים את הסביבה

בקטע הזה נסביר איך ליצור ולהגדיר פרויקט ב-Google Cloud עבור אפליקציית Chat.

יצירת פרויקט של Google Cloud

מסוף Google Cloud

  1. במסוף Google Cloud, נכנסים לתפריט > IAM & אדמין > יצירת פרויקט.

    כניסה לדף Create a Project

  2. בשדה Project Name (שם הפרויקט), מזינים שם תיאורי לפרויקט.

    אופציונלי: כדי לערוך את Project ID, לוחצים על Edit (עריכה). אי אפשר לשנות את מזהה הפרויקט אחרי היצירה שלו, לכן חשוב לבחור מזהה שיעמוד בצרכים שלכם לכל משך חיי הפרויקט.

  3. בשדה Location, לוחצים על Browse כדי להציג מיקומים פוטנציאליים לפרויקט. לאחר מכן לוחצים על בחירה.
  4. לוחצים על יצירה. במסוף Google Cloud עוברים לדף Dashboard ונוצר הפרויקט תוך כמה דקות.

CLI של gcloud

נכנסים ל-Google Cloud באחת מסביבות הפיתוח הבאות CLI (gcloud):

  • Cloud Shell: כדי להשתמש בטרמינל אונליין באמצעות ה-CLI של gcloud כבר הוגדר, צריך להפעיל את Cloud Shell.
    הפעלת Cloud Shell
  • מעטפת מקומית: כדי להשתמש בסביבת פיתוח מקומית צריך להתקין ולהפעיל את ה-CLI של gcloud.
    כדי ליצור פרויקט ב-Cloud, משתמשים בפקודה gcloud projects create:
    gcloud projects create PROJECT_ID
    מחליפים את PROJECT_ID על ידי הגדרת המזהה של הפרויקט שרוצים ליצור.

הגדרת אימות והרשאה

כדי להשתמש באפליקציות של Google Chat, צריך להגדיר מסך הסכמה ל-OAuth כדי שהמשתמשים יוכלו לאשר את האפליקציה שלכם באפליקציות של Google Workspace, כולל Google Chat.

במדריך הזה פורסים אפליקציית Chat שמיועדת רק לשימוש פנימי או לשימוש פנימי, ולכן מותר להשתמש במידע placeholder עבור מסך הסכמה. לפני פרסום אפליקציית Chat, צריך להחליף placeholders עם מידע אמיתי.

  1. במסוף Google Cloud, נכנסים אל תפריט > APIs & Services> OAuth consent screen.

    מעבר למסך ההסכמה של OAuth

  2. בקטע סוג משתמש, בוחרים באפשרות פנימי ולוחצים על יצירה.

  3. בשדה App name, מקלידים Contact Manager.

  4. בקטע User support email (אימייל לתמיכת משתמשים), בוחרים את כתובת האימייל שלכם או כתובת אחרת קבוצה ב-Google.

  5. בקטע פרטים ליצירת קשר עם המפתח, מזינים את כתובת האימייל.

  6. לוחצים על שמירה והמשך.

  7. בדף היקפים לוחצים על שמירה והמשך. (ה אפליקציית Chat לא דורשת היקפי הרשאות OAuth).

  8. מעיינים בסיכום ולוחצים על חזרה ללוח הבקרה.

יצירה ופריסה של אפליקציית Chat

בקטע הבא תעתיקו ותעדכנו פרויקט Apps Script שלם שמכיל את כל קוד האפליקציה הנדרש לאפליקציית Chat, כך שלא תצטרכו להעתיק ולהדביק כל קובץ.

לחלופין, אפשר להציג את הפרויקט כולו ב-GitHub.

הצגת הקוד ב-GitHub

לפניכם סקירה כללית של כל אחד מהקבצים:

main.gs

טיפול בכל הלוגיקה של האפליקציה, כולל אירועי אינטראקציה לגבי המועדים שבהם משתמשים שולחים הודעות לאפליקציית Chat, לוחצים על לחצנים הודעה באפליקציית Chat, או לפתוח ולסגור תיבות דו-שיח.

הצגת הקוד מהאפליקציה main.gs

apps-script/contact-form-app/main.gs
/**
 * Copyright 2024 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Responds to a MESSAGE interaction event in Google Chat.
 *
 * @param {Object} event the MESSAGE interaction event from Chat API.
 * @return {Object} message response that opens a dialog or sends private
 *                          message with text and card.
 */
function onMessage(event) {
  if (event.message.slashCommand) {
    switch (event.message.slashCommand.commandId) {
      case 1:
        // If the slash command is "/about", responds with a text message and button
        // that opens a dialog.
        return {
          text: "Manage your personal and business contacts 📇. To add a " +
                  "contact, use the slash command `/addContact`.",
          accessoryWidgets: [{ buttonList: { buttons: [{
            text: "Add Contact",
            onClick: { action: {
              function: "openDialog",
              interaction: "OPEN_DIALOG"
            }}
          }]}}]
        }
      case 2:
        // If the slash command is "/addContact", opens a dialog.
        return openDialog(event);
    }
  }

  // If user sends the Chat app a message without a slash command, the app responds
  // privately with a text and card to add a contact.
  return {
    privateMessageViewer: event.user,
    text: "To add a contact, try `/addContact` or complete the form below:",
    cardsV2: [{
      cardId: "addContactForm",
      card: {
        header: { title: "Add a contact" },
        sections:[{ widgets: CONTACT_FORM_WIDGETS.concat([{
          buttonList: { buttons: [{
            text: "Review and submit",
            onClick: { action: { function : "openNextCard" }}
          }]}
        }])}]
      }
    }]
  };
}

/**
 * Responds to CARD_CLICKED interaction events in Google Chat.
 *
 * @param {Object} event the CARD_CLICKED interaction event from Google Chat
 * @return {Object} message responses specific to the dialog handling.
 */
function onCardClick(event) {
  // Initial dialog form page
  if (event.common.invokedFunction === "openDialog") {
    return openDialog(event);
  // Second dialog form page
  } else if (event.common.invokedFunction === "openNextCard") {
    return openNextCard(
      event.user,
      fetchFormValue(event, "contactName"),
      fetchFormValue(event, "contactBirthdate"),
      fetchFormValue(event, "contactType"),
      event.isDialogEvent
    );
  // Dialog form submission
  } else if (event.common.invokedFunction === "submitForm") {
    const userInputs = event.common.parameters;
    return submitForm(event.user, userInputs, event.dialogEventType);
  }
}

/**
 * Extracts form input value for a given widget.
 *
 * @param {Object} event the CARD_CLICKED interaction event from Google Chat.
 * @param {String} widgetName a unique ID for the widget, specified in the widget's name field.
 * @returns the value inputted by the user, null if no value can be found.
 */
function fetchFormValue(event, widgetName) {
  const formItem = event.common.formInputs[widgetName][""];
  // For widgets that receive StringInputs data, the value input by the user.
  if (formItem.hasOwnProperty("stringInputs")) {
    const stringInput = event.common.formInputs[widgetName][""].stringInputs.value[0];
    if (stringInput != null) {
      return stringInput;
    }
  // For widgets that receive dateInput data, the value input by the user.
  } else if (formItem.hasOwnProperty("dateInput")) {
    const dateInput = event.common.formInputs[widgetName][""].dateInput.msSinceEpoch;
     if (dateInput != null) {
       return dateInput;
     }
  }

  return null;
}

/**
 * Opens a dialog that prompts users to add details about a contact.
 *
 * @return {Object} a message with an action response to open a dialog.
 */
function openDialog() {
  return { actionResponse: {
    type: "DIALOG",
    dialogAction: { dialog: { body: { sections: [{
      header: "Add new contact",
      widgets: CONTACT_FORM_WIDGETS.concat([{
        buttonList: { buttons: [{
          text: "Review and submit",
          onClick: { action: { function: "openNextCard" }}
        }]}
      }])
    }]}}}
  }};
}

/**
 * Returns a dialog or card message that displays a confirmation of contact
 * details before users submit.
 *
 * @param {String} user the user who submitted the information.
 * @param {String} contactName the contact name from the previous dialog or card.
 * @param {String} contactBirthdate the birthdate from the previous dialog or card.
 * @param {String} contactType the contact type from the previous dialog or card.
 * @param {boolean} fromDialog whether the information was submitted from a dialog.
 *
 * @return {Object} returns a dialog or private card message.
 */
function openNextCard(user, contactName, contactBirthdate, contactType, fromDialog) {
  const name = contactName ?? "<i>Not provided</i>";
  const birthdate = contactBirthdate ?? "<i>Not provided</i>";
  const type = contactType ?? "<i>Not provided</i>";
  const cardConfirmation = {
    header: "Your contact",
    widgets: [{
      textParagraph: { text: "Confirm contact information and submit:" }}, {
      textParagraph: { text: "<b>Name:</b> " + name }}, {
      textParagraph: {
        text: "<b>Birthday:</b> " + convertMillisToDateString(birthdate)
      }}, {
      textParagraph: { text: "<b>Type:</b> " + type }}, {
      buttonList: { buttons: [{
        text: "Submit",
        onClick: { action: {
          function: "submitForm",
          parameters: [{
            key: "contactName", value: name }, {
            key: "contactBirthdate", value: birthdate }, {
            key: "contactType", value: type
          }]
        }}
      }]}
    }]
  };

  // Returns a dialog with contact information that the user input.
  if (fromDialog) {
    return { action_response: {
      type: "DIALOG",
      dialogAction: { dialog: { body: { sections: [ cardConfirmation ]}}}
    }};
  }

  // Updates existing card message with contact information that the user input.
  return {
    actionResponse: { type: "UPDATE_MESSAGE" },
    privateMessageViewer: user,
    cardsV2: [{
      card: { sections: [cardConfirmation]}
    }]
  }
}

/**
  * Submits information from a dialog or card message.
  *
  * @param {Object} user the person who submitted the information.
  * @param {Object} userInputs the form input values from event parameters.
  * @param {boolean} dialogEventType "SUBMIT_DIALOG" if from a dialog.
  * @return {Object} a message response that opens a dialog or posts a private
  *                  message.
  */
function submitForm(user, userInputs, dialogEventType) {
  const contactName = userInputs["contactName"];
  // Checks to make sure the user entered a contact name.
  // If no name value detected, returns an error message.
  if (!contactName) {
    const errorMessage = "Don't forget to name your new contact!";
    if (dialogEventType === "SUBMIT_DIALOG") {
      return { actionResponse: {
        type: "DIALOG",
        dialogAction: { actionStatus: {
          statusCode: "INVALID_ARGUMENT",
          userFacingMessage: errorMessage
        }}
      }};
    } else {
      return {
        privateMessageViewer: user,
        text: errorMessage
      };
    }
  }

  // The Chat app indicates that it received form data from the dialog or card.
  // Sends private text message that confirms submission.
  const confirmationMessage = " " + contactName + " has been added to your contacts.";
  if (dialogEventType === "SUBMIT_DIALOG") {
    return {
      actionResponse: {
        type: "NEW_MESSAGE",
        dialogAction: { actionStatus: {
          statusCode: "OK",
          userFacingMessage: "Success " + JSON.stringify(contactName)
        }}
      },
      privateMessageViewer: user,
      text: confirmationMessage
    }
  } else {
    return {
      actionResponse: { type: "NEW_MESSAGE" },
      privateMessageViewer: user,
      text: confirmationMessage
    };
  }
}

/**
 * Converts date in milliseconds since epoch to user-friendly string.
 *
 * @param {Object} millis the milliseconds since epoch time.
 * @return {string} Display-friend date (English US).
 */
function convertMillisToDateString(millis) {
  const date = new Date(millis);
  const options = { year: 'numeric', month: 'long', day: 'numeric' };
  return date.toLocaleDateString('en-US', options);
}
contactForm.gs

מכיל את הווידג'טים שמקבלים נתוני טפסים ממשתמשים. קלט הטופס הזה והווידג'טים מוצגים בכרטיסים שמופיעים בהודעות ובתיבות הדו-שיח.

הצגת הקוד מהאפליקציה contactForm.gs

apps-script/contact-form-app/contactForm.gs
/**
 * Copyright 2024 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The section of the contact card that contains the form input widgets. Used in a dialog and card message.
 * To add and preview widgets, use the Card Builder: https://addons.gsuite.google.com/uikit/builder
 */
const CONTACT_FORM_WIDGETS = [
  {
    "textInput": {
      "name": "contactName",
      "label": "First and last name",
      "type": "SINGLE_LINE"
    }
  },
  {
    "dateTimePicker": {
      "name": "contactBirthdate",
      "label": "Birthdate",
      "type": "DATE_ONLY"
    }
  },
  {
    "selectionInput": {
      "name": "contactType",
      "label": "Contact type",
      "type": "RADIO_BUTTON",
      "items": [
        {
          "text": "Work",
          "value": "Work",
          "selected": false
        },
        {
          "text": "Personal",
          "value": "Personal",
          "selected": false
        }
      ]
    }
  }
];
appsscript.json

מניפסט של Apps Script שמגדיר ומגדיר את פרויקט Apps Script לאפליקציית Chat.

הצגת קוד appsscript.json

apps-script/contact-form-app/appsscript.json
{
  "timeZone": "America/Los_Angeles",
  "dependencies": {},
  "exceptionLogging": "STACKDRIVER",
  "runtimeVersion": "V8",
  "chat": {}
}

איתור מספר הפרויקט ב-Cloud והמזהה שלו

  1. במסוף Google Cloud, נכנסים לפרויקט ב-Cloud.

    כניסה למסוף Google Cloud

  2. לוחצים על סמל ההגדרות והכלים > הגדרות הפרויקט.

  3. שימו לב לערכים בשדות Project number ו-Project ID. שלך להשתמש בהם בקטעים הבאים.

יצירת פרויקט Apps Script

כדי ליצור פרויקט Apps Script ולקשר אותו לפרויקט ב-Cloud:

  1. לוחצים על הלחצן הבא כדי לפתוח את פרויקט Apps Script ניהול אנשי קשר ב-Google Chat.
    פתיחת הפרויקט
  2. לוחצים על סקירה כללית.
  3. בדף הסקירה הכללית לוחצים על הסמל של יצירת עותק יצירת עותק.
  4. נותנים שם לעותק של פרויקט Apps Script:

    1. לוחצים על עותק של ניהול אנשי הקשר ב-Google Chat.

    2. בשדה Project title, מקלידים Contact Manager - Google Chat app

    3. לוחצים על Rename.

הגדרת פרויקט Cloud של פרויקט Apps Script

  1. בפרויקט של Apps Script, לוחצים על הסמל של הגדרות הפרויקט Project Settings.
  2. בקטע פרויקט ב-Google Cloud Platform (GCP), לוחצים על שינוי פרויקט.
  3. בקטע מספר הפרויקט ב-GCP, מדביקים את מספר הפרויקט ב-Cloud.
  4. לוחצים על Set project (הגדרת פרויקט). הפרויקט ב-Cloud והפרויקט ב-Apps Script מקושרים עכשיו.

יצירת פריסה של Apps Script

עכשיו, אחרי שכל הקוד מוכן, פורסים את הפרויקט ב-Apps Script. משתמשים במזהה הפריסה כשמגדירים את של אפליקציית Chat ב-Google Cloud.

  1. ב-Apps Script, פותחים את אפליקציית Chat פרויקט.

    מעבר אל Apps Script

  2. לוחצים על פריסה > פריסה חדשה.

  3. אם האפשרות תוסף לא נבחרה, לצד בוחרים סוג, לוחצים על סוגי הפריסה הסמל של הגדרות הפרויקט ובוחרים באפשרות תוסף.

  4. בקטע תיאור, מזינים תיאור של הגרסה הזו, למשל Test of Contact Manager.

  5. לוחצים על Deploy (פריסה). הדוחות של Apps Script בוצעו בהצלחה ומספק מזהה פריסה.

  6. לוחצים על Copy כדי להעתיק את מזהה הפריסה, ואז לוחצים על Done.

הגדרת אפליקציית Chat במסוף Google Cloud

בקטע הזה נסביר איך להגדיר את Google Chat API במסוף Google Cloud עם מידע על אפליקציית Chat, כולל מזהה הפריסה שיצרתם זה עתה מהפרויקט ב-Apps Script.

  1. במסוף Google Cloud, לוחצים על תפריט. &gt; מוצרים נוספים &gt; Google Workspace &gt; ספריית המוצרים &gt; Google Chat API &gt; ניהול &gt; הגדרה.

    להגדרת Chat API

  2. בשדה App name, מקלידים Contact Manager.

  3. בשדה כתובת URL של הדמות, מקלידים https://developers.google.com/chat/images/contact-icon.png.

  4. בקטע תיאור, מקלידים Manage your personal and business contacts.

  5. מעבירים את המתג הפעלת תכונות אינטראקטיביות למצב פעיל.

  6. בקטע פונקציונליות, מסמנים את התיבות קבלת הודעות 1:1. איך מצטרפים למרחבים משותפים ולשיחות קבוצתיות

  7. בקטע הגדרות החיבור, בוחרים באפשרות Apps Script.

  8. בקטע Deployment ID (מזהה הפריסה), מדביקים את מזהה הפריסה של Apps Script שהעתקתם בקטע הקודם כשיצרתם את פריסת Apps Script.

  9. בקטע פקודות דרך שורת הפקודות, מגדירים את פקודות הלוכסן /about ו-/addContact:

    1. לוחצים על הוספת פקודה של שורת הפקודות כדי להגדיר את הפקודה הראשונה של הלוכסן.
    2. בשדה Name, מקלידים /about.
    3. בשדה Command ID, מקלידים 1.
    4. בשדה תיאור, מקלידים Learn how to use this Chat app to manage your contacts.
    5. בוחרים באפשרות פתיחה של תיבת דו-שיח.
    6. לוחצים על סיום.
    7. לוחצים על הוספת פקודה דרך שורת הפקודות כדי להגדיר פקודה נוספת דרך שורת הפקודות.
    8. בשדה Name, מקלידים /addContact
    9. בשדה Command ID, מקלידים 2.
    10. בקטע תיאור, מקלידים Submit information about a contact.
    11. בוחרים באפשרות פתיחה של תיבת דו-שיח.
    12. לוחצים על סיום.
  10. בקטע חשיפה, מסמנים את התיבה האפליקציה הזו של Chat תהיה זמינה לאנשים ולקבוצות ספציפיים ב-YOUR DOMAIN ומזינים את כתובת האימייל שלכם.

  11. בקטע Logs (יומנים), בוחרים באפשרות Log errors to Logging (רישום שגיאות ביומן).

  12. לוחצים על שמירה. תופיע ההודעה 'ההגדרה נשמרה'.

אפליקציית Chat מוכנה להתקנה ולבדיקה ב-Chat.

בדיקת האפליקציה של Chat

כדי לבדוק את אפליקציית Chat, פותחים מרחב משותף בצ'אט אישי באפליקציה ושולחים הודעה:

  1. פותחים את Google Chat באמצעות חשבון Google Workspace שבו אתם משתמשים. שקיבלת כשהוספת את עצמך כבודק נאמן.

    כניסה ל-Google Chat

  2. לוחצים על צ'אט חדש.
  3. בשדה אפשר לצרף אנשים, מקלידים את השם של מי שרוצים לצרף אפליקציית Chat.
  4. בוחרים את אפליקציית Chat בתוצאות. A ההודעה תיפתח.

  1. בצ'אט האישי החדש עם אפליקציית Chat: מקלידים /addContact ומקישים Enter.

  2. בתיבת הדו-שיח שנפתחת, מזינים את הפרטים ליצירת קשר:

    1. בשדה הטקסט First and last name, מזינים שם.
    2. בוחרים תאריך בחלונית לבחירת תאריך Birthdate.
    3. בקטע סוג הקשר, בוחרים בלחצן האפשרויות עבודה או אישי.
  3. לוחצים על בדיקה ושליחה.

  4. בתיבת הדו-שיח לאישור, בודקים את המידע ששלחת ולוחצים על שליחה. אפליקציית Chat מספקת תשובות בהודעת טקסט. שלפי ההודעה CONTACT NAME has been added to your contacts.

  5. אפשר גם לבדוק ולשלוח את הטופס ליצירת קשר גם דרכים:

    • משתמשים בפקודה /about. תקבלו תשובה באפליקציית הצ'אט עם הודעת טקסט ולחצן של ווידג'ט עם אביזרים עם הכיתוב Add a contact. אפשר ללחוץ על הלחצן כדי לפתוח תיבת דו-שיח עם טופס ליצירת קשר.
    • שולחים לאפליקציית Chat הודעה בצ'אט אישי בלי להשתמש בפקודה עם קו נטוי, למשל Hello. אפליקציית Chat משיב על טקסט וכרטיס עם הטופס ליצירת קשר.

הסרת המשאבים

כדי להימנע מחיובים בחשבון Google Cloud בגלל השימוש במשאבים שנעשה במסגרת המדריך הזה, מומלץ למחוק את הפרויקט ב-Cloud.

  1. במסוף Google Cloud, עוברים לדף Manage resources. לוחצים על תפריט &gt; IAM & Admin (אדמין) &gt; לניהול משאבים

    מעבר למנהל המשאבים

  2. ברשימת הפרויקטים, בוחרים את הפרויקט שרוצים למחוק ולוחצים על הסמל. מחיקה של .
  3. כדי למחוק את הפרויקט, כותבים את מזהה הפרויקט בתיבת הדו-שיח ולוחצים על Shut down.