c# - tweetinvi, I can't retrieve messages -


i want monitor retrieve messages bot can respond them.

i can send pm using tweetinvi reason, can't retrieve of messages in account. getlastmessage returns null.

i have tried following:

in test, have timer runs every 1s , pols messages.

private static void ontwittertimedevent(object source, system.timers.elapsedeventargs e) {     try     {         ienumerable<imessage> msg  = controller.getlatestmessagesreceived(); ; // message.getlatestmessagesreceived(100);          if (msg != null)         {             console.writeline(msg.elementat(0).senderscreenname + msg.elementat(0).text);              if ((msg.elementat(0).senderid == ####myid#####) & (msg.elementat(0).text == "?"))             {                 message.publishmessage(tweet, ####myid#####);                 console.foregroundcolor = consolecolor.darkgreen;                 console.writeline(msg.elementat(0).senderscreenname + msg.elementat(0).text);                 console.resetcolor();                 message.destroymessage(msg.elementat(0));             }         }     } catch     {         }  } 

i have tried

   private static void ontwittertimedevent(object source, system.timers.elapsedeventargs e)     {          try         {             var latestmessagessent = message.getlatestmessagessent();             var latestmessagessentparameter = new messagessentparameters();             latestmessagessentparameter.pagenumber = 239823;             var latestmessagessentfromparameter = message.getlatestmessagessent(latestmessagessentparameter);              if (latestmessagessentfromparameter != null)             {                 console.writeline("messages send : ");                 foreach (var mms in latestmessagessentfromparameter)                 {                     console.writeline("- '{0}'", mms.text);                 }              }         } catch         {         }      } 

i tried using

iauthenticateduser authenticateduser = user.getauthenticateduser(); authenticateduser.getlatestmessagesreceived();

i using

using system; using system.collections.generic; using system.linq; using system.text; using system.timers; using system.threading.tasks; using system.collections; using system.globalization; //using system.threading; using system.io; using system.net; using system.diagnostics; using system.net; using system.reflection;  // rest api using tweetinvi; using tweetinvi.models; using tweetinvi.parameters;  // stream api using tweetinvi.streaming; using stream = tweetinvi.stream;  // others using tweetinvi.exceptions; // handle exceptions using tweetinvi.core.extensions; // extension methods provided tweetinvi using tweetinvi.models.dto; // data transfer objects serialization using tweetinvi.json; // json static classes json twitter.  


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -