diff --git a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java
index 1842aa0..94e0a12 100644
--- a/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java
+++ b/src/generated/java/net/thauvin/erik/mobibot/ReleaseInfo.java
@@ -14,13 +14,13 @@ import java.time.*;
public final class ReleaseInfo {
public final static String PROJECT = "mobibot";
public final static LocalDateTime BUILDDATE =
- LocalDateTime.ofInstant(Instant.ofEpochMilli(1555731762870L), ZoneId.systemDefault());
+ LocalDateTime.ofInstant(Instant.ofEpochMilli(1555742153981L), ZoneId.systemDefault());
public final static int MAJOR = 0;
public final static int MINOR = 7;
public final static int PATCH = 3;
public final static String PRERELEASE = "beta";
- public final static String BUILDMETA = "303";
- public final static String VERSION = "0.7.3-beta+303";
+ public final static String BUILDMETA = "306";
+ public final static String VERSION = "0.7.3-beta+306";
/**
* Disables the default constructor.
diff --git a/src/main/java/net/thauvin/erik/mobibot/Commands.java b/src/main/java/net/thauvin/erik/mobibot/Commands.java
index b0a825d..1518e3c 100644
--- a/src/main/java/net/thauvin/erik/mobibot/Commands.java
+++ b/src/main/java/net/thauvin/erik/mobibot/Commands.java
@@ -40,120 +40,98 @@ package net.thauvin.erik.mobibot;
* @since 1.0
*/
public final class Commands {
- /**
- * The add (back)log command.
- */
- public static final String ADDLOG_CMD = "addlog";
-
- /**
- * The cycle command.
- */
- public static final String CYCLE_CMD = "cycle";
-
- /**
- * Debug command line argument.
- */
- public static final String DEBUG_ARG = "debug";
-
- /**
- * The debug command.
- */
- public static final String DEBUG_CMD = "debug";
-
- /**
- * The die command.
- */
- public static final String DIE_CMD = "die";
-
- /**
- * Help command line argument.
- */
- public static final String HELP_ARG = "help";
-
- /**
- * The help command.
- */
- public static final String HELP_CMD = "help";
-
- /**
- * The help on posting keyword.
- */
- public static final String HELP_POSTING_KEYWORD = "posting";
-
- /**
- * The help on tags keyword.
- */
- public static final String HELP_TAGS_KEYWORD = "tags";
-
- /**
- * The ignore command.
- */
- public static final String IGNORE_CMD = "ignore";
-
- /**
- * The ignore me
keyword.
- */
- public static final String IGNORE_ME_KEYWORD = "me";
-
- /**
- * The info command.
- */
- public static final String INFO_CMD = "info";
-
/**
* The link command.
*/
public static final String LINK_CMD = "L";
-
- /**
- * The me command.
- */
- public static final String ME_CMD = "me";
-
- /**
- * The msg command.
- */
- public static final String MSG_CMD = "msg";
-
- /**
- * The nick command.
- */
- public static final String NICK_CMD = "nick";
-
- /**
- * Properties command line argument.
- */
- public static final String PROPS_ARG = "properties";
-
- /**
- * The recap command.
- */
- public static final String RECAP_CMD = "recap";
-
- /**
- * The say command.
- */
- public static final String SAY_CMD = "say";
-
- /**
- * The users command.
- */
- public static final String USERS_CMD = "users";
-
- /**
- * Properties version line argument.
- */
- public static final String VERSION_ARG = "version";
-
- /**
- * The version command.
- */
- public static final String VERSION_CMD = "version";
-
/**
* The view command.
*/
public static final String VIEW_CMD = "view";
+ /**
+ * The add (back)log command.
+ */
+ static final String ADDLOG_CMD = "addlog";
+ /**
+ * The cycle command.
+ */
+ static final String CYCLE_CMD = "cycle";
+ /**
+ * Debug command line argument.
+ */
+ static final String DEBUG_ARG = "debug";
+ /**
+ * The debug command.
+ */
+ static final String DEBUG_CMD = "debug";
+ /**
+ * The die command.
+ */
+ static final String DIE_CMD = "die";
+ /**
+ * Help command line argument.
+ */
+ static final String HELP_ARG = "help";
+ /**
+ * The help command.
+ */
+ static final String HELP_CMD = "help";
+ /**
+ * The help on posting keyword.
+ */
+ static final String HELP_POSTING_KEYWORD = "posting";
+ /**
+ * The help on tags keyword.
+ */
+ static final String HELP_TAGS_KEYWORD = "tags";
+ /**
+ * The ignore command.
+ */
+ static final String IGNORE_CMD = "ignore";
+ /**
+ * The ignore me
keyword.
+ */
+ static final String IGNORE_ME_KEYWORD = "me";
+ /**
+ * The info command.
+ */
+ static final String INFO_CMD = "info";
+ /**
+ * The me command.
+ */
+ static final String ME_CMD = "me";
+ /**
+ * The msg command.
+ */
+ static final String MSG_CMD = "msg";
+ /**
+ * The nick command.
+ */
+ static final String NICK_CMD = "nick";
+ /**
+ * Properties command line argument.
+ */
+ static final String PROPS_ARG = "properties";
+ /**
+ * The recap command.
+ */
+ static final String RECAP_CMD = "recap";
+ /**
+ * The say command.
+ */
+ static final String SAY_CMD = "say";
+ /**
+ * The users command.
+ */
+ static final String USERS_CMD = "users";
+ /**
+ * Properties version line argument.
+ */
+ static final String VERSION_ARG = "version";
+ /**
+ * The version command.
+ */
+ static final String VERSION_CMD = "version";
/**
* Disables the default constructor.
diff --git a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java
index 3ea1fcb..53c3a15 100644
--- a/src/main/java/net/thauvin/erik/mobibot/FeedReader.java
+++ b/src/main/java/net/thauvin/erik/mobibot/FeedReader.java
@@ -72,7 +72,7 @@ class FeedReader implements Runnable {
* @param sender The nick of the person who sent the message.
* @param url The URL to fetch.
*/
- public FeedReader(final Mobibot bot, final String sender, final String url) {
+ FeedReader(final Mobibot bot, final String sender, final String url) {
this.bot = bot;
this.sender = sender;
this.url = url;
diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java b/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java
index 12880df..931fc65 100644
--- a/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java
+++ b/src/main/java/net/thauvin/erik/mobibot/modules/Calc.java
@@ -58,7 +58,9 @@ public class Calc extends AbstractModule {
}
/**
- * Calculate.
+ * Performs a calculation.
+ *
+ *
1 + 1 * 2
* * @param query The query. * @return The calculation result. diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java index a35d588..190d50d 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/CurrencyConverter.java @@ -82,6 +82,15 @@ public final class CurrencyConverter extends ThreadedModule { commands.add(CURRENCY_CMD); } + /** + * Converts from a currency to another. + * + *100 USD to EUR
+ * + * @param query The query. + * @return The {@link Message} contained the converted currency. + * @throws ModuleException If an error occurs while converting. + */ static Message convertCurrency(final String query) throws ModuleException { if (EXCHANGE_RATES.isEmpty()) { try { @@ -177,22 +186,6 @@ public final class CurrencyConverter extends ThreadedModule { super.commandResponse(bot, sender, args, isPrivate); } - /** - * {@inheritDoc} - */ - @Override - public void helpResponse(final Mobibot bot, final String sender, final String args, final boolean isPrivate) { - bot.send(sender, "To convert from one currency to another:"); - bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD + " [100 USD to EUR]")); - - if (args.endsWith(CURRENCY_CMD)) { - bot.send(sender, "For a listing of currency rates:"); - bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD) + ' ' + CURRENCY_RATES_KEYWORD); - bot.send(sender, "For a listing of supported currencies:"); - bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD)); - } - } - /** * Converts the specified currencies. */ @@ -215,4 +208,20 @@ public final class CurrencyConverter extends ThreadedModule { } } } + + /** + * {@inheritDoc} + */ + @Override + public void helpResponse(final Mobibot bot, final String sender, final String args, final boolean isPrivate) { + bot.send(sender, "To convert from one currency to another:"); + bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD + " [100 USD to EUR]")); + + if (args.endsWith(CURRENCY_CMD)) { + bot.send(sender, "For a listing of currency rates:"); + bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD) + ' ' + CURRENCY_RATES_KEYWORD); + bot.send(sender, "For a listing of supported currencies:"); + bot.send(sender, bot.helpIndent(bot.getNick() + ": " + CURRENCY_CMD)); + } + } } diff --git a/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java b/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java index 4894afa..866def3 100644 --- a/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java +++ b/src/main/java/net/thauvin/erik/mobibot/modules/GoogleSearch.java @@ -81,8 +81,9 @@ public final class GoogleSearch extends ThreadedModule { * * @param query The search query. * @param apiKey The Google API key. - * The Google CSE key. - * @param cseKey The Google search results. + * @param cseKey The Google CSE key. + * @return The {@link Message} array containing the search results. + * @throws ModuleException If an error occurs while searching. */ @SuppressFBWarnings(value = {"URLCONNECTION_SSRF_FD", "REC_CATCH_EXCEPTION"}) static ArrayListtrue
if the message is queued.
*/
- public LocalDateTime getQueued() {
+ LocalDateTime getQueued() {
return queued;
}
@@ -112,7 +112,7 @@ public class TellMessage implements Serializable {
*
* @return The recipient of the message.
*/
- public String getRecipient() {
+ String getRecipient() {
return recipient;
}
@@ -131,7 +131,7 @@ public class TellMessage implements Serializable {
* @param nick The nickname to match with.
* @return true
if the nickname matches.
*/
- public boolean isMatch(final String nick) {
+ boolean isMatch(final String nick) {
return (sender.equalsIgnoreCase(nick) || recipient.equalsIgnoreCase(nick));
}
@@ -141,7 +141,7 @@ public class TellMessage implements Serializable {
* @param id The ID to match with.
* @return true
if the id matches.
*/
- public boolean isMatchId(final String id) {
+ boolean isMatchId(final String id) {
return this.id.equals(id);
}
@@ -150,7 +150,7 @@ public class TellMessage implements Serializable {
*
* @return true
if the sender has been notified.
*/
- public boolean isNotified() {
+ boolean isNotified() {
return isNotified;
}
@@ -166,14 +166,14 @@ public class TellMessage implements Serializable {
/**
* Sets the notified flag.
*/
- public void setIsNotified() {
+ void setIsNotified() {
isNotified = true;
}
/**
* Sets the received flag.
*/
- public void setIsReceived() {
+ void setIsReceived() {
received = LocalDateTime.now(Clock.systemUTC());
isReceived = true;
}
diff --git a/src/main/java/net/thauvin/erik/mobibot/tell/TellMessagesMgr.java b/src/main/java/net/thauvin/erik/mobibot/tell/TellMessagesMgr.java
index 6c9ca27..4579c4c 100644
--- a/src/main/java/net/thauvin/erik/mobibot/tell/TellMessagesMgr.java
+++ b/src/main/java/net/thauvin/erik/mobibot/tell/TellMessagesMgr.java
@@ -73,7 +73,7 @@ final class TellMessagesMgr {
* @param tellMaxDays The maximum number of days to keep messages for.
* @return True
if the queue was cleaned.
*/
- public static boolean clean(final List