add scoresaber #1 feed

This commit is contained in:
Lee
2024-06-25 11:55:26 +01:00
parent b37a30b0a3
commit e9422793cb
29 changed files with 376 additions and 60 deletions

View File

@ -1,4 +1,4 @@
package cc.fascinated.bat.model.guild;
package cc.fascinated.bat.model;
import cc.fascinated.bat.common.Profile;
import cc.fascinated.bat.service.DiscordService;

View File

@ -1,4 +1,4 @@
package cc.fascinated.bat.model.user;
package cc.fascinated.bat.model;
import cc.fascinated.bat.common.Profile;
import cc.fascinated.bat.service.DiscordService;

View File

@ -1,75 +0,0 @@
package cc.fascinated.bat.model.guild.profiles;
import cc.fascinated.bat.common.Profile;
import cc.fascinated.bat.service.DiscordService;
import lombok.Getter;
import lombok.Setter;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import java.util.ArrayList;
import java.util.List;
/**
* @author Fascinated (fascinated7)
*/
@Getter @Setter
public class ScoreSaberUserScoreFeedProfile extends Profile {
public ScoreSaberUserScoreFeedProfile() {
super("scoresaber-user-score-feed");
}
/**
* The channel ID of the score feed
*/
private String channelId;
/**
* The users that are being tracked
*/
private List<String> trackedUsers;
/**
* Gets the tracked users
*
* @return the tracked users
*/
public List<String> getTrackedUsers() {
if (this.trackedUsers == null) {
this.trackedUsers = new ArrayList<>();
}
return this.trackedUsers;
}
/**
* Adds a user to be tracked
*
* @param userId the user ID to add
*/
public void addTrackedUser(String userId) {
if (this.trackedUsers == null) {
this.trackedUsers = new ArrayList<>();
}
trackedUsers.add(userId);
}
/**
* Removes a user from being tracked
*
* @param userId the user ID to remove
*/
public void removeTrackedUser(String userId) {
if (this.trackedUsers == null) {
this.trackedUsers = new ArrayList<>();
}
trackedUsers.remove(userId);
}
/**
* Gets the channel as a TextChannel
*
* @return the channel as a TextChannel
*/
public TextChannel getAsTextChannel() {
return DiscordService.JDA.getTextChannelById(channelId);
}
}

View File

@ -1,20 +0,0 @@
package cc.fascinated.bat.model.user.profiles;
import cc.fascinated.bat.common.Profile;
import lombok.Getter;
import lombok.Setter;
/**
* @author Fascinated (fascinated7)
*/
@Setter @Getter
public class ScoreSaberProfile extends Profile {
/**
* The Account ID of the ScoreSaber profile
*/
private String id;
public ScoreSaberProfile() {
super("scoresaber");
}
}