Version 2.0 of sigIRC rewritten and remastered for Java. Includes "Modules" which can be enabled/disabled to modify functionality of the program.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sigIRCv2/src/sig/modules/Twitch/Announcement.java

46 lines
1015 B

package sig.modules.Twitch;
import java.io.File;
import java.text.DateFormat;
import com.mb3364.twitch.api.models.User;
import sig.modules.TwitchModule;
import sig.utils.FileUtils;
public class Announcement {
Follower userData;
long twitchID;
public Announcement(long twitchID) {
String userFilePath = TwitchModule.USERDIR+twitchID;
File userFile = new File(userFilePath);
if (userFile.exists()) {
int i=0;
String[] contents = FileUtils.readFromFile(userFilePath);
userData = new Follower(twitchID,
contents[i++],
"",
contents[i++],
contents[i++],
contents[i++],
contents[i++],
"");
} else {
System.out.println("WARNING! Could not find user with ID "+twitchID+"!");
}
this.twitchID=twitchID;
}
public Announcement(Follower data) {
this.userData=data;
this.twitchID=data.id;
}
public String toString() {
return userData.toString();
}
public Follower getUser() {
return userData;
}
}