List of usage examples for twitter4j Twitter destroyDirectMessage
void destroyDirectMessage(long id) throws TwitterException;
From source file:com.ikungolf.java.javatwitter.directmessage.DestroyDirectMessage.java
License:Apache License
/** * Usage: java twitter4j.examples.directmessages.DestroyDirectMessage [message id] * * @param args message/*from ww w .j a va2s . co m*/ */ public static void main(String[] args) { if (args.length < 1) { System.out.println("Usage: java twitter4j.examples.directmessages.DestroyDirectMessage [message id]"); System.exit(-1); } try { Twitter twitter = new TwitterFactory().getInstance(); twitter.destroyDirectMessage(Long.parseLong(args[0])); System.out.println("Successfully deleted message [" + args[0] + "]."); System.exit(0); } catch (TwitterException te) { te.printStackTrace(); System.out.println("Failed to delete message: " + te.getMessage()); System.exit(-1); } }