List of usage examples for twitter4j AsyncTwitter sendDirectMessage
void sendDirectMessage(long userId, String text);
From source file:com.marpies.ane.twitter.functions.SendDirectMessageFunction.java
License:Apache License
@Override public FREObject call(FREContext context, FREObject[] args) { super.call(context, args); String message = FREObjectUtils.getString(args[0]); long userID = FREObjectUtils.getDouble(args[1]).longValue(); String screenName = (args[2] == null) ? null : FREObjectUtils.getString(args[2]); mCallbackID = FREObjectUtils.getInt(args[3]); AsyncTwitter twitter = TwitterAPI.getAsyncInstance(TwitterAPI.getAccessToken()); twitter.addListener(this); if (screenName != null) { twitter.sendDirectMessage(screenName, message); } else {//from w ww . ja v a2 s. c o m twitter.sendDirectMessage(userID, message); } return null; }