Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,12 @@ public FavoriteScreenshot() {
public void handle() {
try {
final File favoritedScreenshots = getTimestampedPNGFileForDirectory(new File("./favorite_screenshots"));
screenshot.delete();

if (!favoritedScreenshots.exists()) {
favoritedScreenshots.mkdirs();
}

ImageIO.write(image, "png", favoritedScreenshots);
screenshot.delete();
ChatUtilities.sendNotification("Screenshot Manager", "&e" + screenshot.getName() + " has been favorited.");
} catch (Throwable e) {
ChatUtilities.sendNotification("Screenshot Manager", "&cFailed to favorite screenshot, maybe the file was moved/deleted?");
Expand Down