Added temporary bot-log redirect for zammy event
This commit is contained in:
parent
a21b3471e1
commit
18be26d5ca
@ -77,6 +77,15 @@ public class EditMetaCommand extends Command {
|
|||||||
.setColor(Color.YELLOW)
|
.setColor(Color.YELLOW)
|
||||||
.addField("Edited By:", ctx.getAuthor().getDiscriminatedName());
|
.addField("Edited By:", ctx.getAuthor().getDiscriminatedName());
|
||||||
|
|
||||||
|
// TODO: START ZAMMY
|
||||||
|
if (outfit.getTag().equals("zammy"))
|
||||||
|
{
|
||||||
|
ctx.getApi().getServerTextChannelById(BotConfig.ZAMMY_LOG).ifPresent(
|
||||||
|
chnl -> chnl.sendMessage(log)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// TODO: END ZAMMY
|
||||||
|
|
||||||
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
||||||
chnl -> chnl.sendMessage(log)
|
chnl -> chnl.sendMessage(log)
|
||||||
);
|
);
|
||||||
|
@ -77,6 +77,15 @@ public class RemoveOutfitCommand extends Command {
|
|||||||
.setColor(Color.RED)
|
.setColor(Color.RED)
|
||||||
.addField("Deleted By:", ctx.getAuthor().getDiscriminatedName());
|
.addField("Deleted By:", ctx.getAuthor().getDiscriminatedName());
|
||||||
|
|
||||||
|
// TODO: START ZAMMY
|
||||||
|
if (outfit.getTag().equals("zammy"))
|
||||||
|
{
|
||||||
|
ctx.getApi().getServerTextChannelById(BotConfig.ZAMMY_LOG).ifPresent(
|
||||||
|
chnl -> chnl.sendMessage(log)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// TODO: END ZAMMY
|
||||||
|
|
||||||
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
||||||
chnl -> chnl.sendMessage(log)
|
chnl -> chnl.sendMessage(log)
|
||||||
);
|
);
|
||||||
|
@ -78,6 +78,15 @@ public class RestoreOutfitCommand extends Command {
|
|||||||
.setColor(Color.BLUE)
|
.setColor(Color.BLUE)
|
||||||
.addField("Restored By:", ctx.getAuthor().getDiscriminatedName());
|
.addField("Restored By:", ctx.getAuthor().getDiscriminatedName());
|
||||||
|
|
||||||
|
// TODO: START ZAMMY
|
||||||
|
if (outfit.getTag().equals("zammy"))
|
||||||
|
{
|
||||||
|
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
||||||
|
chnl -> chnl.sendMessage(log)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// TODO: END ZAMMY
|
||||||
|
|
||||||
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
||||||
chnl -> chnl.sendMessage(log)
|
chnl -> chnl.sendMessage(log)
|
||||||
);
|
);
|
||||||
|
@ -81,6 +81,15 @@ public class RetagCommand extends Command {
|
|||||||
.setThumbnail(outfit.getLink())
|
.setThumbnail(outfit.getLink())
|
||||||
.addField("New tag:", newTag);
|
.addField("New tag:", newTag);
|
||||||
|
|
||||||
|
// TODO: START ZAMMY
|
||||||
|
if (outfit.getTag().equals("zammy"))
|
||||||
|
{
|
||||||
|
ctx.getApi().getServerTextChannelById(BotConfig.ZAMMY_LOG).ifPresent(
|
||||||
|
chnl -> chnl.sendMessage(log)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// TODO: END ZAMMY
|
||||||
|
|
||||||
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
ctx.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresent(
|
||||||
chnl -> chnl.sendMessage(log)
|
chnl -> chnl.sendMessage(log)
|
||||||
);
|
);
|
||||||
|
@ -56,6 +56,9 @@ public class BotConfig {
|
|||||||
@ConfigurationOption
|
@ConfigurationOption
|
||||||
public static String OUTFIT_LOG = "outfit log channel";
|
public static String OUTFIT_LOG = "outfit log channel";
|
||||||
|
|
||||||
|
@ConfigurationOption
|
||||||
|
public static String ZAMMY_LOG = "zammy log here";
|
||||||
|
|
||||||
@ConfigurationOption
|
@ConfigurationOption
|
||||||
public static String ACTIVITY_LOG = "bot_log_channel";
|
public static String ACTIVITY_LOG = "bot_log_channel";
|
||||||
|
|
||||||
|
@ -118,6 +118,43 @@ public class ImageListener implements MessageCreateListener {
|
|||||||
|
|
||||||
OutfitController.insert(outfit).thenAcceptAsync((Void) -> {
|
OutfitController.insert(outfit).thenAcceptAsync((Void) -> {
|
||||||
// Log the outfit
|
// Log the outfit
|
||||||
|
|
||||||
|
// TODO: START ZAMMY LOG
|
||||||
|
if (outfit.getTag().equals("zammy"))
|
||||||
|
{
|
||||||
|
event.getApi().getServerTextChannelById(BotConfig.ZAMMY_LOG).ifPresentOrElse(chnl ->
|
||||||
|
{
|
||||||
|
EmbedBuilder response = new EmbedBuilder()
|
||||||
|
.setTitle("Outfit Added")
|
||||||
|
.setAuthor(event.getMessageAuthor())
|
||||||
|
.setThumbnail(outfit.getLink())
|
||||||
|
.setFooter(String.format("%s | %s", outfit.getTag(), outfit.getId()))
|
||||||
|
.setUrl(outfit.getLink())
|
||||||
|
.setColor(Color.GREEN)
|
||||||
|
.addField("Uploaded:", outfit.getCreated().toString())
|
||||||
|
.addField("Discord Name:", outfit.getDiscordName());
|
||||||
|
|
||||||
|
if (!outfit.getMeta().equals("")) {
|
||||||
|
response.addField("Meta:", outfit.getMeta());
|
||||||
|
}
|
||||||
|
|
||||||
|
chnl.sendMessage(response);
|
||||||
|
logger.info(String.format("Outfit from %s successfully added to the zammy event.", event.getMessageAuthor().getDiscriminatedName()));
|
||||||
|
|
||||||
|
// Add the reaction to the original message
|
||||||
|
GalleryController.getEmoji(channel.getIdAsString()).thenAcceptAsync(
|
||||||
|
emoji -> event.getMessage().addReaction(EmojiParser.parseToUnicode(emoji))
|
||||||
|
).exceptionally(ExceptionLogger.get());
|
||||||
|
}, () ->
|
||||||
|
{
|
||||||
|
// Fallback error message to me
|
||||||
|
event.getApi().getUserById(BotConfig.BOT_OWNER).thenAcceptAsync(
|
||||||
|
user -> user.sendMessage("Could not find OUTFIT LOG")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// TODO: END ZAMMY LOG
|
||||||
|
|
||||||
event.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresentOrElse(chnl -> {
|
event.getApi().getServerTextChannelById(BotConfig.OUTFIT_LOG).ifPresentOrElse(chnl -> {
|
||||||
EmbedBuilder response = new EmbedBuilder()
|
EmbedBuilder response = new EmbedBuilder()
|
||||||
.setTitle("Outfit Added")
|
.setTitle("Outfit Added")
|
||||||
|
Loading…
Reference in New Issue
Block a user