عرض قائمة برموز الإيموجي المخصّصة في مؤسسة

يشرح هذا الدليل كيفية استخدام طريقة list في المورد CustomEmoji في Google Chat API لعرض قائمة برموز الإيموجي المخصّصة المرئية للمستخدم الذي تمت مصادقته في مؤسسة Google Workspace.

لا تتوفّر الرموز التعبيرية المخصّصة إلا لحسابات Google Workspace، ويجب أن يفعِّلها المشرف لمؤسستك. لمزيد من المعلومات، يُرجى الاطّلاع على المقالتَين التعرّف على رموز الإيموجي المخصّصة في Google Chat وإدارة أذونات رموز الإيموجي المخصّصة.

المتطلبات الأساسية

Node.js

عرض قائمة برموز الإيموجي المخصّصة في مؤسسة

لعرض رموز الإيموجي المخصّصة في مؤسسة تتضمّن مصادقة المستخدم، أدرِج ما يلي في طلبك:

  • حدِّد chat.customemojis نطاق التفويض.
  • استدعِ طريقة ListCustomEmojis.

تعرض قائمة الأمثلة التالية رموز إيموجي مخصّصة في مؤسسة.

Node.js

chat/client-libraries/cloud/list-custom-emojis-user-cred.js
import {createClientWithUserCredentials} from './authentication-utils.js';

const USER_AUTH_OAUTH_SCOPES = ['https://www.googleapis.com/auth/chat.customemojis'];

// This sample shows how to get custom emoji with user credential
async function main() {
  // Create a client
  const chatClient = await createClientWithUserCredentials(USER_AUTH_OAUTH_SCOPES);

  // Initialize request argument(s)
  const request = {
    // Optional. Replace FILTER here
    filter: 'FILTER'
  };

  // Make the request
  const pageResult = await chatClient.listCustomEmojisAsync(request);

  // Handle the response. Iterating over pageResult will yield results and
  // resolve additional pages automatically.
  for await (const response of pageResult) {
    console.log(response);
  }
}

main().catch(console.error);

لتشغيل هذا النموذج، استبدِل ما يلي:

  • FILTER: اختياري، وهو الفلتر الذي سيتم تطبيقه على طلب القائمة.