From a7c0efad1511892289d1c0befa1d23aa44f5c197 Mon Sep 17 00:00:00 2001 From: Mazawrath Date: Sat, 12 Jan 2019 15:18:03 -0600 Subject: [PATCH 1/4] Fixed an issue with Discord not creating new thumbnail previews --- .../utilities/LivestreamNotification.java | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/mazawrath/beanbot/utilities/LivestreamNotification.java b/src/main/java/com/mazawrath/beanbot/utilities/LivestreamNotification.java index 3077645..29fafb2 100644 --- a/src/main/java/com/mazawrath/beanbot/utilities/LivestreamNotification.java +++ b/src/main/java/com/mazawrath/beanbot/utilities/LivestreamNotification.java @@ -1,6 +1,6 @@ package com.mazawrath.beanbot.utilities; -import java.net.URL; +import java.util.Random; public class LivestreamNotification { private String userId; @@ -16,7 +16,7 @@ public LivestreamNotification(String userId, String userName, String title, Stri this.title = title; this.gameId = gameId; this.viewerCount = viewerCount; - this.thumbnail = thumbnail.replace("{width}x{height}", "1920x1080"); + this.thumbnail = thumbnail.replace("{width}x{height}", "1920x1080") + "?rnd=" + randomPasswordGenerator(6); } String getUserId() { @@ -42,4 +42,32 @@ int getViewerCount() { String getThumbnail() { return thumbnail; } + + private String randomPasswordGenerator(int passwordLength) { + // A strong password has Cap_chars, Lower_chars, + // numeric value and symbols. So we are using all of + // them to generate our password + String Capital_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + String Small_chars = "abcdefghijklmnopqrstuvwxyz"; + String numbers = "0123456789"; + //String symbols = "!@#$%^&*_=+-/.?<>)"; + + + String values = Capital_chars + Small_chars + + numbers; + + // Using random method + Random random_method = new Random(); + + char[] password = new char[passwordLength]; + + for (int i = 0; i < passwordLength; i++) { + // Use of charAt() method : to get character value + // Use of nextInt() as it is scanning the value as int + password[i] = + values.charAt(random_method.nextInt(values.length())); + + } + return String.valueOf(password); + } } From d51e805777b9664fe3239e7a2611aadd28e2b25e Mon Sep 17 00:00:00 2001 From: Mazawrath Date: Sat, 12 Jan 2019 16:04:25 -0600 Subject: [PATCH 2/4] Expanded lottery numbers that could be drawn --- src/main/java/com/mazawrath/beanbot/utilities/Lottery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/mazawrath/beanbot/utilities/Lottery.java b/src/main/java/com/mazawrath/beanbot/utilities/Lottery.java index cf87010..9b70b8a 100644 --- a/src/main/java/com/mazawrath/beanbot/utilities/Lottery.java +++ b/src/main/java/com/mazawrath/beanbot/utilities/Lottery.java @@ -19,7 +19,7 @@ public class Lottery { public static final int AMOUNT_DRAWN = 3; public static final int MIN_NUMBER = 1; - public static final int MAX_NUMBER = 20; + public static final int MAX_NUMBER = 40; public static final BigDecimal MIN_WEEKLY_VALUE = new BigDecimal(50000); private static final String DB_NAME = "beanBotLottery"; From f31f082ee031fd9d7f32fcea72504b4e25496101 Mon Sep 17 00:00:00 2001 From: Mazawrath Date: Sat, 12 Jan 2019 16:07:44 -0600 Subject: [PATCH 3/4] Changed price of bean lottery tickets --- src/main/java/com/mazawrath/beanbot/utilities/Points.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/mazawrath/beanbot/utilities/Points.java b/src/main/java/com/mazawrath/beanbot/utilities/Points.java index abffc20..90a7937 100644 --- a/src/main/java/com/mazawrath/beanbot/utilities/Points.java +++ b/src/main/java/com/mazawrath/beanbot/utilities/Points.java @@ -23,7 +23,7 @@ public class Points { public static final BigDecimal FREE_POINTS = new BigDecimal("25.69").setScale(SCALE, ROUNDING_MODE); public static final BigDecimal COMMAND_COST = new BigDecimal("2.00").setScale(SCALE, ROUNDING_MODE); public static final BigDecimal COMMAND_COST_SPECIAL = new BigDecimal("10.00").setScale(SCALE, ROUNDING_MODE); - public static final BigDecimal LOTTERY_TICKET_COST = new BigDecimal("20.00").setScale(SCALE, ROUNDING_MODE); + public static final BigDecimal LOTTERY_TICKET_COST = new BigDecimal("40.00").setScale(SCALE, ROUNDING_MODE); public static final BigDecimal LOTTERY_DRAWING_COST = new BigDecimal("20000.00").setScale(SCALE, ROUNDING_MODE); public static final BigDecimal GOOGLE_VISION_COST = new BigDecimal("50.00").setScale(SCALE, ROUNDING_MODE); private Connection conn; From fed835a93d2b3bce70425dd7604ef7ea448b8c36 Mon Sep 17 00:00:00 2001 From: Mazawrath Date: Sat, 12 Jan 2019 16:08:37 -0600 Subject: [PATCH 4/4] Updated changelog --- .../admin/AdminPostChangeLogCommand.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/mazawrath/beanbot/commands/admin/AdminPostChangeLogCommand.java b/src/main/java/com/mazawrath/beanbot/commands/admin/AdminPostChangeLogCommand.java index 9d5716d..97b2ae1 100644 --- a/src/main/java/com/mazawrath/beanbot/commands/admin/AdminPostChangeLogCommand.java +++ b/src/main/java/com/mazawrath/beanbot/commands/admin/AdminPostChangeLogCommand.java @@ -34,17 +34,19 @@ public void onCommand(String[] args, DiscordApi api, ServerTextChannel serverTex private String getRecentChangeLog() { return "**New beanBOT update released.**\n" + - "Release can be found on https://github.com/Mazawrath/beanBOT/releases/tag/v3.2.0\n" + - "Detailed changelog can be found on https://github.com/Mazawrath/beanBOT/compare/v3.1.1...v3.2.0\n" + + "Release can be found on https://github.com/Mazawrath/beanBOT/releases/tag/v3.2.1\n" + + "Detailed changelog can be found on https://github.com/Mazawrath/beanBOT/compare/v3.2.0...v3.2.1\n" + "\n" + - "**v3.2.0**\n" + - "**New**\n" + - "\t- Added `.analyze`.\n" + - "\t\t- Using Google Cloud Vision, beanBOT can now examine a photo for objects, faces, emotions, and more.\n" + + "**v3.2.1**\n" + +// "**New**\n" + +// "\t- Added `.analyze`.\n" + +// "\t\t- Using Google Cloud Vision, beanBOT can now examine a photo for objects, faces, emotions, and more.\n" + // "\t\t- Server owners can now type `.admintwitch add [twitch channel name]` to subscribe to live notifications for a twitch channel.\n" + "**Changes**\n" + - "\t- Disabled `.beanlottery draw`."; -// "**Bug Fixes**\n" + -// "\t- Fixed an issue with `.beanlottery` not giving help information.\n"; + "\t- Cleaned up analyze command.\n" + + "\t- Expanded lottery numbers that could be drawn from 20 to 40.\n" + + "\t- Raised price of beanLottery tickets from 20 beanCoin to 40 beanCoin.\n" + + "**Bug Fixes**\n" + + "\t- Fixed an issue with Discord not creating new thumbnail previews.\n"; } } \ No newline at end of file