Search in sources :

Example 1 with Cooldown

use of gg.projecteden.nexus.framework.commands.models.annotations.Cooldown in project Nexus by ProjectEdenGG.

the class ModReviewCommand method request.

@Cooldown(value = TickTime.SECOND, x = 30)
@Path("request <name> [notes...]")
@Description("Request a mod to be reviewed by the staff team")
void request(String name, String notes) {
    ModReviewRequest request = new ModReviewRequest(uuid(), name, notes);
    modReview.request(request);
    save();
    send(PREFIX + "Requested mod &e" + name + " &3to be reviewed");
    String message = "&e" + name() + " &3has requested mod &e" + name + " &3to be reviewed";
    Broadcast.staff().prefix("ModReview").message(json(message).command("/modreview requests")).send();
}
Also used : ModReviewRequest(gg.projecteden.nexus.models.modreview.ModReview.ModReviewRequest) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Description(gg.projecteden.nexus.framework.commands.models.annotations.Description) Cooldown(gg.projecteden.nexus.framework.commands.models.annotations.Cooldown)

Example 2 with Cooldown

use of gg.projecteden.nexus.framework.commands.models.annotations.Cooldown in project Nexus by ProjectEdenGG.

the class CurrentTimeCommand method update.

@Path("update [player]")
@Cooldown(value = TickTime.HOUR, bypass = Group.SENIOR_STAFF)
void update(@Arg(value = "self", permission = Group.SENIOR_STAFF) Player player) {
    final String name = isSelf(player) ? "your" : Nickname.of(player) + "'s";
    send(PREFIX + "Updating " + name + " timezone information...");
    GeoIP geoip = service.request(player.getUniqueId(), player.getAddress().getHostString());
    if (geoip == null || geoip.getIp() == null)
        error("There was an error while updating " + name + " timezone. Please try again later.");
    service.save(geoip);
    send(PREFIX + "Updated " + name + " timezone to &3" + geoip.getTimezone());
}
Also used : GeoIP(gg.projecteden.nexus.models.geoip.GeoIP) Path(gg.projecteden.nexus.framework.commands.models.annotations.Path) Cooldown(gg.projecteden.nexus.framework.commands.models.annotations.Cooldown)

Aggregations

Cooldown (gg.projecteden.nexus.framework.commands.models.annotations.Cooldown)2 Path (gg.projecteden.nexus.framework.commands.models.annotations.Path)2 Description (gg.projecteden.nexus.framework.commands.models.annotations.Description)1 GeoIP (gg.projecteden.nexus.models.geoip.GeoIP)1 ModReviewRequest (gg.projecteden.nexus.models.modreview.ModReview.ModReviewRequest)1