use of me.shadorc.shadbot.data.premium.RelicType in project Shadbot by Shadorc.
the class GenerateRelicCmd method execute.
@Override
public void execute(Context context) throws MissingArgumentException, IllegalCmdArgumentException {
if (!context.hasArg()) {
throw new MissingArgumentException();
}
RelicType type = Utils.getValueOrNull(RelicType.class, context.getArg());
if (type == null) {
throw new IllegalCmdArgumentException(String.format("`%s`in not a valid type. %s", context.getArg(), FormatUtils.formatOptions(RelicType.class)));
}
Relic relic = PremiumManager.generateRelic(type);
BotUtils.sendMessage(String.format(Emoji.CHECK_MARK + " %s relic generated: **%s**", StringUtils.capitalize(type.toString()), relic.getRelicID()), context.getChannel());
}
Aggregations