= Format updates and color iteration

This commit is contained in:
Matthew Cech
2019-06-17 22:50:43 -07:00
parent 4eee13a359
commit e76bb6bb27
11 changed files with 85 additions and 24 deletions
+27 -5
View File
@@ -4,6 +4,7 @@ import java.io.File;
import java.io.InputStream;
import net.dv8tion.jda.core.JDA;
import net.dv8tion.jda.core.MessageBuilder;
import net.dv8tion.jda.core.entities.TextChannel;
import net.dv8tion.jda.core.events.message.guild.*;
import net.dv8tion.jda.core.EmbedBuilder;
@@ -51,12 +52,33 @@ public class Response
embed.setAuthor(embedInfo.authorText, embedInfo.authorLink, embedInfo.authorImage);
if(embedInfo.imageURL != null)
embed.setImage(embedInfo.imageURL);
embed.setImage(embedInfo.imageURL);
if(embedInfo.thumbnailURL != null)
embed.setThumbnail(embedInfo.thumbnailURL);
event.getChannel().sendMessage(embed.build()).queue();
if(embedInfo.thumbnailURL != null && embedInfo.thumbnailURL.contains("attachment://"))
{
// This is the case where you have a thumbnail image, but you want it to be a local file.
// TODO: Make this more generic. Consider message builder for the entire thing.
String thumbPath = embedInfo.thumbnailURL;
String thumbName = thumbPath.replace("attachment://", "");
MessageBuilder message = new MessageBuilder();
embed.setThumbnail(thumbPath);
message.setEmbed(embed.build());
File thumbImage = new File(thumbName);
if(thumbImage.exists())
{
event.getChannel().sendFile(thumbImage, thumbName, message.build()).queue();
}
}
else
{
if(embedInfo.thumbnailURL != null)
embed.setThumbnail(embedInfo.thumbnailURL);
event.getChannel().sendMessage(embed.build());
}
}
// Queues a standard text-based message response to the channel that issued the command.