Renamed UrlMgr to LinksMgr.

This commit is contained in:
Erik C. Thauvin 2020-04-30 14:51:02 -07:00
parent 725937bf61
commit 8bc04b0940
12 changed files with 50 additions and 69 deletions

View file

@ -14,6 +14,6 @@
<ID>MagicNumber:View.kt$View$8</ID> <ID>MagicNumber:View.kt$View$8</ID>
<ID>NestedBlockDepth:Addons.kt$Addons$add</ID> <ID>NestedBlockDepth:Addons.kt$Addons$add</ID>
<ID>NestedBlockDepth:Comment.kt$Comment$commandResponse</ID> <ID>NestedBlockDepth:Comment.kt$Comment$commandResponse</ID>
<ID>NestedBlockDepth:UrlMgr.kt$UrlMgr$commandResponse</ID> <ID>NestedBlockDepth:LinksMgr.kt$LinksMgr$commandResponse</ID>
</Whitelist> </Whitelist>
</SmellBaseline> </SmellBaseline>

View file

@ -48,9 +48,9 @@ import net.thauvin.erik.mobibot.commands.Say;
import net.thauvin.erik.mobibot.commands.Users; import net.thauvin.erik.mobibot.commands.Users;
import net.thauvin.erik.mobibot.commands.Versions; import net.thauvin.erik.mobibot.commands.Versions;
import net.thauvin.erik.mobibot.commands.links.Comment; import net.thauvin.erik.mobibot.commands.links.Comment;
import net.thauvin.erik.mobibot.commands.links.LinksMgr;
import net.thauvin.erik.mobibot.commands.links.Posting; import net.thauvin.erik.mobibot.commands.links.Posting;
import net.thauvin.erik.mobibot.commands.links.Tags; import net.thauvin.erik.mobibot.commands.links.Tags;
import net.thauvin.erik.mobibot.commands.links.UrlMgr;
import net.thauvin.erik.mobibot.commands.links.View; import net.thauvin.erik.mobibot.commands.links.View;
import net.thauvin.erik.mobibot.commands.tell.Tell; import net.thauvin.erik.mobibot.commands.tell.Tell;
import net.thauvin.erik.mobibot.entries.EntriesMgr; import net.thauvin.erik.mobibot.entries.EntriesMgr;
@ -96,6 +96,7 @@ import java.nio.file.Paths;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.Timer; import java.util.Timer;
import java.util.regex.Pattern;
import static org.apache.commons.lang3.StringUtils.isNotBlank; import static org.apache.commons.lang3.StringUtils.isNotBlank;
import static org.apache.commons.lang3.StringUtils.lowerCase; import static org.apache.commons.lang3.StringUtils.lowerCase;
@ -184,8 +185,8 @@ public class Mobibot extends PircBot {
// Load the current entries and backlogs, if any // Load the current entries and backlogs, if any
try { try {
UrlMgr.startup(logsDir + EntriesMgr.CURRENT_XML, logsDir + EntriesMgr.NAV_XML, ircChannel); LinksMgr.startup(logsDir + EntriesMgr.CURRENT_XML, logsDir + EntriesMgr.NAV_XML, ircChannel);
LOGGER.debug("Last feed: {}", UrlMgr.getStartDate()); LOGGER.debug("Last feed: {}", LinksMgr.getStartDate());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("An error occurred while loading the logs.", e); LOGGER.error("An error occurred while loading the logs.", e);
} }
@ -228,7 +229,7 @@ public class Mobibot extends PircBot {
addons.add(new Comment(this), p); addons.add(new Comment(this), p);
addons.add(new Posting(this), p); addons.add(new Posting(this), p);
addons.add(new Tags(this), p); addons.add(new Tags(this), p);
addons.add(new UrlMgr(this), p); addons.add(new LinksMgr(this), p);
addons.add(new View(this), p); addons.add(new View(this), p);
// Load the modules // Load the modules
@ -253,7 +254,7 @@ public class Mobibot extends PircBot {
addons.sort(); addons.sort();
// Save the entries // Save the entries
UrlMgr.saveEntries(this, true); LinksMgr.saveEntries(this, true);
} }
/** /**
@ -286,20 +287,20 @@ public class Mobibot extends PircBot {
// Parse the command line // Parse the command line
final CommandLineParser parser = new DefaultParser(); final CommandLineParser parser = new DefaultParser();
CommandLine line = null; CommandLine commandLine = null;
try { try {
line = parser.parse(options, args); commandLine = parser.parse(options, args);
} catch (ParseException e) { } catch (ParseException e) {
System.err.println("CLI Parsing failed. Reason: " + e.getMessage()); System.err.println("CLI Parsing failed. Reason: " + e.getMessage());
e.printStackTrace(System.err); e.printStackTrace(System.err);
System.exit(1); System.exit(1);
} }
if (line.hasOption(Constants.HELP_ARG.charAt(0))) { if (commandLine.hasOption(Constants.HELP_ARG.charAt(0))) {
// Output the usage // Output the usage
new HelpFormatter().printHelp(Mobibot.class.getName(), options); new HelpFormatter().printHelp(Mobibot.class.getName(), options);
} else if (line.hasOption(Constants.VERSION_ARG.charAt(0))) { } else if (commandLine.hasOption(Constants.VERSION_ARG.charAt(0))) {
for (final String s : INFO) { for (final String s : INFO) {
System.out.println(s); System.out.println(s);
} }
@ -307,7 +308,7 @@ public class Mobibot extends PircBot {
final Properties p = new Properties(); final Properties p = new Properties();
try (final InputStream fis = Files.newInputStream( try (final InputStream fis = Files.newInputStream(
Paths.get(line.getOptionValue(Constants.PROPS_ARG.charAt(0), "./mobibot.properties")))) { Paths.get(commandLine.getOptionValue(Constants.PROPS_ARG.charAt(0), "./mobibot.properties")))) {
// Load the properties files // Load the properties files
p.load(fis); p.load(fis);
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
@ -325,7 +326,7 @@ public class Mobibot extends PircBot {
final String logsDir = Utils.ensureDir(p.getProperty("logs", "."), false); final String logsDir = Utils.ensureDir(p.getProperty("logs", "."), false);
// Redirect the stdout and stderr // Redirect the stdout and stderr
if (!line.hasOption(Constants.DEBUG_ARG.charAt(0))) { if (!commandLine.hasOption(Constants.DEBUG_ARG.charAt(0))) {
try { try {
final PrintStream stdout = new PrintStream( final PrintStream stdout = new PrintStream(
new FileOutputStream(logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true)); new FileOutputStream(logsDir + channel.substring(1) + '.' + Utils.today() + ".log", true));
@ -493,26 +494,6 @@ public class Mobibot extends PircBot {
return addons.getModulesNames(); return addons.getModulesNames();
} }
/**
* Returns the bot's nickname regexp pattern.
*
* @return The nickname regexp pattern.
*/
private String getNickPattern() {
final StringBuilder buff = new StringBuilder(0);
for (final char c : getNick().toCharArray()) {
if (Character.isLetter(c)) {
buff.append('[').append(lowerCase(String.valueOf(c))).append(StringUtils.upperCase(String.valueOf(c)))
.append(']');
} else {
buff.append(c);
}
}
return buff.toString();
}
/** /**
* Returns the Tell command. * Returns the Tell command.
* *
@ -700,7 +681,7 @@ public class Mobibot extends PircBot {
tell.send(sender, true); tell.send(sender, true);
if (message.matches(getNickPattern() + ":.*")) { // mobibot: <command> if (message.matches("(?i)" + Pattern.quote(getNick()) + ":.*")) { // mobibot: <command>
final String[] cmds = message.substring(message.indexOf(':') + 1).trim().split(" ", 2); final String[] cmds = message.substring(message.indexOf(':') + 1).trim().split(" ", 2);
final String cmd = lowerCase(cmds[0]); final String cmd = lowerCase(cmds[0]);

View file

@ -33,8 +33,8 @@
package net.thauvin.erik.mobibot.commands package net.thauvin.erik.mobibot.commands
import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Mobibot
import net.thauvin.erik.mobibot.commands.links.UrlMgr.Companion.addHistory import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.addHistory
import net.thauvin.erik.mobibot.commands.links.UrlMgr.Companion.getHistory import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.getHistory
import net.thauvin.erik.mobibot.entries.EntriesMgr import net.thauvin.erik.mobibot.entries.EntriesMgr
import java.io.File import java.io.File

View file

@ -34,7 +34,7 @@ package net.thauvin.erik.mobibot.commands
import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Mobibot
import net.thauvin.erik.mobibot.Utils import net.thauvin.erik.mobibot.Utils
import net.thauvin.erik.mobibot.commands.links.UrlMgr import net.thauvin.erik.mobibot.commands.links.LinksMgr
import java.util.* import java.util.*
class Ignore(bot: Mobibot) : AbstractCommand(bot) { class Ignore(bot: Mobibot) : AbstractCommand(bot) {
@ -150,7 +150,7 @@ class Ignore(bot: Mobibot) : AbstractCommand(bot) {
override fun setProperty(key: String, value: String) { override fun setProperty(key: String, value: String) {
super.setProperty(key, value) super.setProperty(key, value)
if (IGNORE_PROP == key) { if (IGNORE_PROP == key) {
ignored.addAll(value.split(UrlMgr.LINK_MATCH.toRegex())) ignored.addAll(value.split(LinksMgr.LINK_MATCH.toRegex()))
} }
} }

View file

@ -34,7 +34,7 @@ package net.thauvin.erik.mobibot.commands
import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Mobibot
import net.thauvin.erik.mobibot.Utils import net.thauvin.erik.mobibot.Utils
import net.thauvin.erik.mobibot.commands.links.UrlMgr import net.thauvin.erik.mobibot.commands.links.LinksMgr
import java.lang.management.ManagementFactory import java.lang.management.ManagementFactory
class Info(bot: Mobibot) : AbstractCommand(bot) { class Info(bot: Mobibot) : AbstractCommand(bot) {
@ -63,7 +63,7 @@ class Info(bot: Mobibot) : AbstractCommand(bot) {
with(info) { with(info) {
append(Utils.uptime(ManagementFactory.getRuntimeMXBean().uptime)) append(Utils.uptime(ManagementFactory.getRuntimeMXBean().uptime))
append(" [Entries: ") append(" [Entries: ")
append(UrlMgr.entriesCount) append(LinksMgr.entriesCount)
if (isOp) { if (isOp) {
if (bot.tell.isEnabled()) { if (bot.tell.isEnabled()) {

View file

@ -68,8 +68,8 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) {
val cmds = args.substring(1).split("[.:]".toRegex(), 3) val cmds = args.substring(1).split("[.:]".toRegex(), 3)
val index = cmds[0].toInt() - 1 val index = cmds[0].toInt() - 1
if (index < UrlMgr.entriesCount) { if (index < LinksMgr.entriesCount) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
val commentIndex = cmds[1].toInt() - 1 val commentIndex = cmds[1].toInt() - 1
if (commentIndex < entry.commentsCount) { if (commentIndex < entry.commentsCount) {
when (val cmd = cmds[2].trim()) { when (val cmd = cmds[2].trim()) {
@ -124,7 +124,7 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) {
val comment = entry.getComment(commentIndex) val comment = entry.getComment(commentIndex)
comment.nick = cmd.substring(1) comment.nick = cmd.substring(1)
bot.send(EntriesUtils.buildComment(index, commentIndex, comment)) bot.send(EntriesUtils.buildComment(index, commentIndex, comment))
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} else { } else {
bot.send(sender, "Please ask a channel op to change the author of this comment for you.", false) bot.send(sender, "Please ask a channel op to change the author of this comment for you.", false)
} }
@ -141,7 +141,7 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) {
if (isOp || sender == entry.getComment(commentIndex).nick) { if (isOp || sender == entry.getComment(commentIndex).nick) {
entry.deleteComment(commentIndex) entry.deleteComment(commentIndex)
bot.send("Comment ${Constants.LINK_CMD}${index + 1}.${commentIndex + 1} removed.") bot.send("Comment ${Constants.LINK_CMD}${index + 1}.${commentIndex + 1} removed.")
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} else { } else {
bot.send(sender, "Please ask a channel op to delete this comment for you.", false) bot.send(sender, "Please ask a channel op to delete this comment for you.", false)
} }
@ -151,7 +151,7 @@ class Comment(bot: Mobibot) : AbstractCommand(bot) {
entry.setComment(commentIndex, cmd, sender) entry.setComment(commentIndex, cmd, sender)
val comment = entry.getComment(commentIndex) val comment = entry.getComment(commentIndex)
bot.send(sender, EntriesUtils.buildComment(index, commentIndex, comment), false) bot.send(sender, EntriesUtils.buildComment(index, commentIndex, comment), false)
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} }
private fun showComment(bot: Mobibot, entry: EntryLink, index: Int, commentIndex: Int) { private fun showComment(bot: Mobibot, entry: EntryLink, index: Int, commentIndex: Int) {

View file

@ -43,7 +43,7 @@ import net.thauvin.erik.mobibot.entries.EntryLink
import org.jsoup.Jsoup import org.jsoup.Jsoup
import java.io.IOException import java.io.IOException
class UrlMgr(bot: Mobibot) : AbstractCommand(bot) { class LinksMgr(bot: Mobibot) : AbstractCommand(bot) {
private val keywords: MutableList<String> = ArrayList() private val keywords: MutableList<String> = ArrayList()
private val defaultTags: MutableList<String> = ArrayList() private val defaultTags: MutableList<String> = ArrayList()

View file

@ -67,7 +67,7 @@ class Posting(bot: Mobibot) : AbstractCommand(bot) {
val cmds = args.substring(1).split(":", limit = 2) val cmds = args.substring(1).split(":", limit = 2)
val index = cmds[0].toInt() - 1 val index = cmds[0].toInt() - 1
if (index < UrlMgr.entriesCount) { if (index < LinksMgr.entriesCount) {
when (val cmd = cmds[1].trim()) { when (val cmd = cmds[1].trim()) {
"" -> showEntry(index) "" -> showEntry(index)
"-" -> removeEntry(sender, login, isOp, index) // L1:- "-" -> removeEntry(sender, login, isOp, index) // L1:-
@ -88,33 +88,33 @@ class Posting(bot: Mobibot) : AbstractCommand(bot) {
} }
private fun addComment(cmd: String, sender: String, index: Int) { private fun addComment(cmd: String, sender: String, index: Int) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
val commentIndex = entry.addComment(cmd, sender) val commentIndex = entry.addComment(cmd, sender)
val comment = entry.getComment(commentIndex) val comment = entry.getComment(commentIndex)
bot.send(sender, EntriesUtils.buildComment(index, commentIndex, comment), false) bot.send(sender, EntriesUtils.buildComment(index, commentIndex, comment), false)
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} }
private fun changeTitle(cmd: String, index: Int) { private fun changeTitle(cmd: String, index: Int) {
if (cmd.length > 1) { if (cmd.length > 1) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
entry.title = cmd.substring(1).trim() entry.title = cmd.substring(1).trim()
bot.updatePin(entry.link, entry) bot.updatePin(entry.link, entry)
bot.send(EntriesUtils.buildLink(index, entry)) bot.send(EntriesUtils.buildLink(index, entry))
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} }
} }
private fun changeUrl(cmd: String, login: String, isOp: Boolean, index: Int) { private fun changeUrl(cmd: String, login: String, isOp: Boolean, index: Int) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
if (entry.login == login || isOp) { if (entry.login == login || isOp) {
val link = cmd.substring(1) val link = cmd.substring(1)
if (link.matches(UrlMgr.LINK_MATCH.toRegex())) { if (link.matches(LinksMgr.LINK_MATCH.toRegex())) {
val oldLink = entry.link val oldLink = entry.link
entry.link = link entry.link = link
bot.updatePin(oldLink, entry) bot.updatePin(oldLink, entry)
bot.send(EntriesUtils.buildLink(index, entry)) bot.send(EntriesUtils.buildLink(index, entry))
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} }
} }
} }
@ -122,10 +122,10 @@ class Posting(bot: Mobibot) : AbstractCommand(bot) {
private fun changeAuthor(cmd: String, sender: String, isOp: Boolean, index: Int) { private fun changeAuthor(cmd: String, sender: String, isOp: Boolean, index: Int) {
if (isOp) { if (isOp) {
if (cmd.length > 1) { if (cmd.length > 1) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
entry.nick = cmd.substring(1) entry.nick = cmd.substring(1)
bot.send(EntriesUtils.buildLink(index, entry)) bot.send(EntriesUtils.buildLink(index, entry))
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} }
} else { } else {
bot.send(sender, "Please ask a channel op to change the author of this link for you.", false) bot.send(sender, "Please ask a channel op to change the author of this link for you.", false)
@ -133,19 +133,19 @@ class Posting(bot: Mobibot) : AbstractCommand(bot) {
} }
private fun removeEntry(sender: String, login: String, isOp: Boolean, index: Int) { private fun removeEntry(sender: String, login: String, isOp: Boolean, index: Int) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
if (entry.login == login || isOp) { if (entry.login == login || isOp) {
bot.deletePin(index, entry) bot.deletePin(index, entry)
UrlMgr.removeEntry(index) LinksMgr.removeEntry(index)
bot.send("Entry ${Constants.LINK_CMD}${index + 1} removed.") bot.send("Entry ${Constants.LINK_CMD}${index + 1} removed.")
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} else { } else {
bot.send(sender, "Please ask a channel op to remove this entry for you.", false) bot.send(sender, "Please ask a channel op to remove this entry for you.", false)
} }
} }
private fun showEntry(index: Int) { private fun showEntry(index: Int) {
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
bot.send(EntriesUtils.buildLink(index, entry)) bot.send(EntriesUtils.buildLink(index, entry))
if (entry.hasTags()) { if (entry.hasTags()) {
bot.send(EntriesUtils.buildTags(index, entry)) bot.send(EntriesUtils.buildTags(index, entry))

View file

@ -63,15 +63,15 @@ class Tags(bot: Mobibot) : AbstractCommand(bot) {
val cmds = args.substring(1).split("T:", limit = 2) val cmds = args.substring(1).split("T:", limit = 2)
val index = cmds[0].toInt() - 1 val index = cmds[0].toInt() - 1
if (index < UrlMgr.entriesCount) { if (index < LinksMgr.entriesCount) {
val cmd = cmds[1].trim() val cmd = cmds[1].trim()
val entry: EntryLink = UrlMgr.getEntry(index) val entry: EntryLink = LinksMgr.getEntry(index)
if (cmd.isNotEmpty()) { if (cmd.isNotEmpty()) {
if (entry.login == login || isOp) { if (entry.login == login || isOp) {
entry.setTags(cmd) entry.setTags(cmd)
bot.updatePin(entry.link, entry) bot.updatePin(entry.link, entry)
bot.send(EntriesUtils.buildTags(index, entry)) bot.send(EntriesUtils.buildTags(index, entry))
UrlMgr.saveEntries(bot, false) LinksMgr.saveEntries(bot, false)
} else { } else {
bot.send(sender, "Please ask a channel op to change the tags for you.",isPrivate) bot.send(sender, "Please ask a channel op to change the tags for you.",isPrivate)
} }

View file

@ -35,8 +35,8 @@ package net.thauvin.erik.mobibot.commands.links
import net.thauvin.erik.mobibot.Mobibot import net.thauvin.erik.mobibot.Mobibot
import net.thauvin.erik.mobibot.Utils import net.thauvin.erik.mobibot.Utils
import net.thauvin.erik.mobibot.commands.AbstractCommand import net.thauvin.erik.mobibot.commands.AbstractCommand
import net.thauvin.erik.mobibot.commands.links.UrlMgr.Companion.entriesCount import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.entriesCount
import net.thauvin.erik.mobibot.commands.links.UrlMgr.Companion.getEntry import net.thauvin.erik.mobibot.commands.links.LinksMgr.Companion.getEntry
import net.thauvin.erik.mobibot.entries.EntriesUtils import net.thauvin.erik.mobibot.entries.EntriesUtils
import net.thauvin.erik.mobibot.entries.EntryLink import net.thauvin.erik.mobibot.entries.EntryLink

View file

@ -35,7 +35,7 @@ package net.thauvin.erik.mobibot.entries;
import com.rometools.rome.feed.synd.SyndCategory; import com.rometools.rome.feed.synd.SyndCategory;
import com.rometools.rome.feed.synd.SyndCategoryImpl; import com.rometools.rome.feed.synd.SyndCategoryImpl;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import net.thauvin.erik.mobibot.commands.links.UrlMgr; import net.thauvin.erik.mobibot.commands.links.LinksMgr;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import java.io.Serializable; import java.io.Serializable;
@ -347,7 +347,7 @@ public class EntryLink implements Serializable {
* @param tags The space-delimited tags. * @param tags The space-delimited tags.
*/ */
public final void setTags(final String tags) { public final void setTags(final String tags) {
setTags(Arrays.asList(tags.split(UrlMgr.TAG_MATCH))); setTags(Arrays.asList(tags.split(LinksMgr.TAG_MATCH)));
} }
/** /**

View file

@ -38,7 +38,7 @@ import net.thauvin.erik.mobibot.Mobibot;
import net.thauvin.erik.mobibot.ReleaseInfo; import net.thauvin.erik.mobibot.ReleaseInfo;
import net.thauvin.erik.mobibot.TwitterTimer; import net.thauvin.erik.mobibot.TwitterTimer;
import net.thauvin.erik.mobibot.Utils; import net.thauvin.erik.mobibot.Utils;
import net.thauvin.erik.mobibot.commands.links.UrlMgr; import net.thauvin.erik.mobibot.commands.links.LinksMgr;
import net.thauvin.erik.mobibot.entries.EntryLink; import net.thauvin.erik.mobibot.entries.EntryLink;
import net.thauvin.erik.mobibot.msg.Message; import net.thauvin.erik.mobibot.msg.Message;
import net.thauvin.erik.mobibot.msg.NoticeMessage; import net.thauvin.erik.mobibot.msg.NoticeMessage;
@ -221,8 +221,8 @@ public final class Twitter extends ThreadedModule {
*/ */
@SuppressFBWarnings("SUI_CONTAINS_BEFORE_REMOVE") @SuppressFBWarnings("SUI_CONTAINS_BEFORE_REMOVE")
public final void postEntry(final int index) { public final void postEntry(final int index) {
if (isAutoPost() && hasEntry(index) && UrlMgr.getEntriesCount() >= index) { if (isAutoPost() && hasEntry(index) && LinksMgr.getEntriesCount() >= index) {
final EntryLink entry = UrlMgr.getEntry(index); final EntryLink entry = LinksMgr.getEntry(index);
final String msg = final String msg =
entry.getTitle() + ' ' + entry.getLink() + " via " + entry.getNick() + " on " + bot.getChannel(); entry.getTitle() + ' ' + entry.getLink() + " via " + entry.getNick() + " on " + bot.getChannel();
new Thread(() -> { new Thread(() -> {