Fixed twitter autopost initialization (was too early.)
This commit is contained in:
parent
d2339044e6
commit
2067a228aa
1 changed files with 10 additions and 8 deletions
|
@ -130,8 +130,6 @@ public class Mobibot extends PircBot {
|
|||
private static final String DEFAULT_SERVER = "irc.freenode.net";
|
||||
// Maximum number of times the bot will try to reconnect, if disconnected
|
||||
private static final int MAX_RECONNECT = 10;
|
||||
// Number of milliseconds to delay between consecutive messages
|
||||
private static final long MESSAGE_DELAY = 1000L;
|
||||
// Logger
|
||||
private static final Logger logger = LogManager.getLogger(Mobibot.class);
|
||||
// Ignore command
|
||||
|
@ -226,7 +224,7 @@ public class Mobibot extends PircBot {
|
|||
setAutoNickChange(true);
|
||||
setLogin(p.getProperty("login", getName()));
|
||||
setVersion(p.getProperty("weblog", ""));
|
||||
setMessageDelay(MESSAGE_DELAY);
|
||||
// setMessageDelay(1000);
|
||||
setIdentity(p.getProperty("ident", ""), p.getProperty("ident-nick", ""), p.getProperty("ident-msg", ""));
|
||||
|
||||
// Set the URLs
|
||||
|
@ -278,12 +276,10 @@ public class Mobibot extends PircBot {
|
|||
addModule(new RockPaperScissors());
|
||||
addModule(new StockQuote());
|
||||
|
||||
// Twitter
|
||||
twitterModule = new Twitter();
|
||||
addModule(twitterModule);
|
||||
twitterHandle = p.getProperty(Constants.TWITTER_HANDLE_PROP, "");
|
||||
isTwitterAutoPost =
|
||||
Boolean.parseBoolean(p.getProperty(Constants.TWITTER_AUTOPOST_PROP, "false"))
|
||||
&& twitterModule.isEnabled();
|
||||
|
||||
addModule(new War());
|
||||
addModule(new Weather2());
|
||||
addModule(new WorldTime());
|
||||
|
@ -295,6 +291,12 @@ public class Mobibot extends PircBot {
|
|||
}
|
||||
});
|
||||
|
||||
// Twitter extra properties
|
||||
twitterHandle = p.getProperty(Constants.TWITTER_HANDLE_PROP, "");
|
||||
isTwitterAutoPost =
|
||||
Boolean.parseBoolean(p.getProperty(Constants.TWITTER_AUTOPOST_PROP, "false"))
|
||||
&& twitterModule.isEnabled();
|
||||
|
||||
// Save the entries
|
||||
UrlMgr.saveEntries(this, true);
|
||||
}
|
||||
|
@ -492,7 +494,7 @@ public class Mobibot extends PircBot {
|
|||
if (isNotBlank(feedUrl)) {
|
||||
new Thread(new FeedReader(this, sender, feedUrl)).start();
|
||||
} else {
|
||||
send(sender, "There is no weblog setup for this channel.", false);
|
||||
send(sender, "There is no feed setup for this channel.", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue