<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Webex Bot to send private messages after prompt from space? in Webex for Developers</title>
    <link>https://community.cisco.com/t5/webex-for-developers/webex-bot-to-send-private-messages-after-prompt-from-space/m-p/4627157#M990</link>
    <description>&lt;P&gt;Hi, I'm working on part of a Bot that would send a private message to every member of a space after being prompted in the main space (or on a timed basis). Does anyone have any resources for this? I can only see material for sending a message within a space.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2022 13:30:56 GMT</pubDate>
    <dc:creator>rekane</dc:creator>
    <dc:date>2022-06-07T13:30:56Z</dc:date>
    <item>
      <title>Webex Bot to send private messages after prompt from space?</title>
      <link>https://community.cisco.com/t5/webex-for-developers/webex-bot-to-send-private-messages-after-prompt-from-space/m-p/4627157#M990</link>
      <description>&lt;P&gt;Hi, I'm working on part of a Bot that would send a private message to every member of a space after being prompted in the main space (or on a timed basis). Does anyone have any resources for this? I can only see material for sending a message within a space.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 13:30:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/webex-bot-to-send-private-messages-after-prompt-from-space/m-p/4627157#M990</guid>
      <dc:creator>rekane</dc:creator>
      <dc:date>2022-06-07T13:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Webex Bot to send private messages after prompt from space?</title>
      <link>https://community.cisco.com/t5/webex-for-developers/webex-bot-to-send-private-messages-after-prompt-from-space/m-p/4627200#M991</link>
      <description>&lt;P&gt;Figured this out. For anyone else who may have the same problem, there is a bot.dm() function which takes the person's ID and the message you'd like to send. Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;PRE&gt;bot.webex.memberships.list({roomId: bot.room.id})&lt;BR /&gt;.then((memberships) =&amp;gt; {&lt;BR /&gt;for (const member of memberships.items) {&lt;BR /&gt;if (member.personId === bot.person.id) {&lt;BR /&gt;// Skip the bot&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;BR /&gt;let displayName = (member.personDisplayName) ? member.personDisplayName : member.personEmail;&lt;BR /&gt;bot.dm(member.personId, `Hello ${displayName}, please add your availability`);&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;.catch((e) =&amp;gt; {&lt;BR /&gt;console.error(`Call to sdk.memberships.get() failed: ${e.messages}`);&lt;BR /&gt;bot.say('Tried to send reminders, failed');&lt;BR /&gt;});&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This loops through the memberships in a given room/space and sends a direct message to each person.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Tue, 07 Jun 2022 14:20:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/webex-bot-to-send-private-messages-after-prompt-from-space/m-p/4627200#M991</guid>
      <dc:creator>rekane</dc:creator>
      <dc:date>2022-06-07T14:20:38Z</dc:date>
    </item>
  </channel>
</rss>

