use of net.kodehawa.mantarobot.db.entities.helpers.PremiumKeyData in project MantaroBot by Mantaro.
the class DBGuild method generateAndApplyPremiumKey.
@JsonIgnore
public PremiumKey generateAndApplyPremiumKey(int days) {
String premiumId = UUID.randomUUID().toString();
PremiumKey newKey = new PremiumKey(premiumId, TimeUnit.DAYS.toMillis(days), currentTimeMillis() + TimeUnit.DAYS.toMillis(days), PremiumKey.Type.GUILD, true, id, new PremiumKeyData());
data.setPremiumKey(premiumId);
newKey.saveAsync();
saveAsync();
return newKey;
}
Aggregations