Search in sources :

Example 1 with PremiumKeyData

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;
}
Also used : PremiumKeyData(net.kodehawa.mantarobot.db.entities.helpers.PremiumKeyData) JsonIgnore(com.fasterxml.jackson.annotation.JsonIgnore)

Aggregations

JsonIgnore (com.fasterxml.jackson.annotation.JsonIgnore)1 PremiumKeyData (net.kodehawa.mantarobot.db.entities.helpers.PremiumKeyData)1