Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package samplebot;
- import java.io.*;
- import java.util.*;
- import java.util.regex.*;
- import com.cericlabs.jcnlib.*;
- import com.cericlabs.jcnlib.consts.*;
- import com.cericlabs.jcnlib.util.*;
- import com.cericlabs.jcnlib.util.commands.*;
- import winterwell.jtwitter.*;
- public class TweetCommand implements CommandHandler
- {
- private INIReader objINIReader;
- private String Username;
- private String Password;
- private String BotOwner;
- public TweetCommand() {
- // INI configuration
- Username = objINIReader.get("Twitter", "Username"); //Twitter Username
- Password = objINIReader.get("Twitter", "Password"); //Twitter Password
- BotOwner = objINIReader.get("BotInfo", "Owner"); //Bot Owner
- }
- public void handleCommand(CNConnection connection, String player, ChatType ctype, String command, String arguments) {
- System.out.println(player + " is using the " + command + " command.");
- if(ctype == ChatType.PRIVATE)
- {
- objINIReader.open((new File ("twitter.ini")));
- Twitter twitter = new Twitter(Username , Password); //establish connection with Twitter
- twitter.setStatus(arguments); //sets Twitter Status
- connection.sendPrivateMessage(player, Username+"'s Twitter Status is now: "+ arguments);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement