Advertisement
r_best_paste

Send Message to Skype group within an interval

Mar 20th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ((() => {
  2.   // First I store the reference from the first inbox
  3.   server.post('/api/messages', (req, res) => {
  4.     adapter.processActivity(req, res, async (context) => {
  5.       const reference = TurnContext.getConversationReference(context.activity);
  6.  
  7.  
  8.       // Call the function that sends message within an interval
  9.       sendMessageNow(reference);
  10.     })
  11.   })
  12.  
  13.   // Secondly I use the reference to continue the conversation
  14.   function sendMessageNow() {
  15.     setInterval(async () => {
  16.       await adapter.continueConversation(JSON.parse(reference), async (context) => {
  17.         await context.sendActivity("Sending a new message");
  18.       });
  19.     }, 5000);
  20.   }
  21. })())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement