-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added !reddit command. #148
base: master
Are you sure you want to change the base?
Added !reddit command. #148
Conversation
f74707b
to
620c29d
Compare
@@ -78,7 +116,7 @@ public static void main( String[] args ) | |||
|
|||
Configuration botConfiguration = | |||
new Configuration.Builder().setName( ircNick ).setLogin( ircUser ).setRealName( ircRealName ).addServer( ircServerAddress, | |||
ircPort ).addAutoJoinChannel( ircChannel ).setAutoReconnect( true ).addListener( new Vilebot() ).addListener( new AdminManagement() ).addListener( new AdminPing() ).addListener( new Auth() ).addListener( new GetLog() ).addListener( new com.oldterns.vilebot.handlers.admin.Help() ).addListener( new NickChange() ).addListener( new com.oldterns.vilebot.handlers.admin.Ops() ).addListener( new Quit() ).addListener( new AnswerQuestion() ).addListener( new Ascii() ).addListener( new ChatLogger() ).addListener( new Church() ).addListener( new Countdown() ).addListener( new Decide() ).addListener( new Excuses() ).addListener( new FakeNews() ).addListener( new Fortune() ).addListener( new GetInfoOn() ).addListener( new Help() ).addListener( new ImageToAscii() ).addListener( new Inspiration() ).addListener( new Jaziz() ).addListener( new Jokes() ).addListener( new Kaomoji() ).addListener( new Karma() ).addListener( new KarmaRoll() ).addListener( new LastMessageSed() ).addListener( new LastSeen() ).addListener( new Markov() ).addListener( new News() ).addListener( new Omgword() ).addListener( new Ops() ).addListener( new QuotesAndFacts() ).addListener( new RemindMe() ).addListener( new RockPaperScissors() ).addListener( new Trivia() ).addListener( new Ttc() ).addListener( new TwitterCorrection() ).addListener( new UrlTitleAnnouncer() ).addListener( new UrlTweetAnnouncer() ).addListener( new Userlists() ).addListener( new UserPing() ).addListener( new Weather() ).buildConfiguration(); | |||
ircPort ).addAutoJoinChannel( ircChannel ).setAutoReconnect( true ).addListener( new Vilebot() ).addListener( new AdminManagement() ).addListener( new AdminPing() ).addListener( new Auth() ).addListener( new GetLog() ).addListener( new com.oldterns.vilebot.handlers.admin.Help() ).addListener( new NickChange() ).addListener( new com.oldterns.vilebot.handlers.admin.Ops() ).addListener( new Quit() ).addListener( new AnswerQuestion() ).addListener( new Ascii() ).addListener( new ChatLogger() ).addListener( new Church() ).addListener( new Countdown() ).addListener( new Decide() ).addListener( new Excuses() ).addListener( new FakeNews() ).addListener( new Fortune() ).addListener( new GetInfoOn() ).addListener( new Help() ).addListener( new ImageToAscii() ).addListener( new Inspiration() ).addListener( new Jaziz() ).addListener( new Jokes() ).addListener( new Kaomoji() ).addListener( new Karma() ).addListener( new KarmaRoll() ).addListener( new LastMessageSed() ).addListener( new LastSeen() ).addListener( new Markov() ).addListener( new News() ).addListener( new Omgword() ).addListener( new Ops() ).addListener( new QuotesAndFacts() ).addListener( new Reddit() ).addListener( new RemindMe() ).addListener( new RockPaperScissors() ).addListener( new Trivia() ).addListener( new Ttc() ).addListener( new TwitterCorrection() ).addListener( new UrlTitleAnnouncer() ).addListener( new UrlTweetAnnouncer() ).addListener( new Userlists() ).addListener( new UserPing() ).addListener( new Weather() ).buildConfiguration(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y'all, what is this line? Ends on column 1645?? At the very least break it up a little:
Configuration botConfiguration =
new Configuration.Builder()
.setName( ircNick )
.setLogin( ircUser )
.setRealName( ircRealName )
.addServer( ircServerAddress, ircPort )
.addAutoJoinChannel( ircChannel )
.setAutoReconnect( true )
.addListener( new Vilebot() )
.addListener( new AdminManagement() )
.addListener( new AdminPing() )
.addListener( new Auth() )
.addListener( new GetLog() )
.addListener( new com.oldterns.vilebot.handlers.admin.Help() )
.addListener( new NickChange() )
.addListener( new com.oldterns.vilebot.handlers.admin.Ops() )
.addListener( new Quit() )
.addListener( new AnswerQuestion() )
.addListener( new Ascii() )
.addListener( new ChatLogger() )
.addListener( new Church() )
.addListener( new Countdown() )
.addListener( new Decide() )
.addListener( new Excuses() )
.addListener( new FakeNews() )
.addListener( new Fortune() )
.addListener( new GetInfoOn() )
.addListener( new Help() )
.addListener( new ImageToAscii() )
.addListener( new Inspiration() )
.addListener( new Jaziz() )
.addListener( new Jokes() )
.addListener( new Kaomoji() )
.addListener( new Karma() )
.addListener( new KarmaRoll() )
.addListener( new LastMessageSed() )
.addListener( new LastSeen() )
.addListener( new Markov() )
.addListener( new News() )
.addListener( new Omgword() )
.addListener( new Ops() )
.addListener( new QuotesAndFacts() )
.addListener( new Reddit() )
.addListener( new RemindMe() )
.addListener( new RockPaperScissors() )
.addListener( new Trivia() )
.addListener( new Ttc() )
.addListener( new TwitterCorrection() )
.addListener( new UrlTitleAnnouncer() )
.addListener( new UrlTweetAnnouncer() )
.addListener( new Userlists() )
.addListener( new UserPing() )
.addListener( new Weather() )
.buildConfiguration();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The VIleBot1 formatter does that. However, this task should be done in a more generic way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was a running joke tbh, which is why I never bothered to reformat it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running jokes have no place in code, not even in joke code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the formatter is busted. Alternatively,
Builder builder = new Configuration.Builder();
builder.setName( ircNick );
builder.setLogin( ircUser )
// [...]
@@ -61,7 +61,7 @@ | |||
// update cache when new quotes/facts added | |||
private Map<String, Integer> dumpSize = new HashMap<>(); | |||
|
|||
private static final String PASTEBIN_API_URL = Vilebot.getConfig().get("pastebinApiUrl"); | |||
private static final String PASTEBIN_API_URL = Vilebot.getConfig().get( "pastebinApiUrl" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for fixing this formatting, never got around to doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mvn
did it for me; if you run mvn clean install
it will auto-format your code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some good fixes in this PR, +1! Please add some unit tests as well. Refer to NewsTest.java
for examples. Other than that looks good!
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.regex.Matcher; | ||
|
||
public abstract class NewsParser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this class is used for something other than news parsing, maybe rename it to something more generic like FeedParser
? Not a blocker, just a recommendation.
No description provided.