-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
165 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/me/mrdoc/twitchtopcheers/bot/listener/GeneralListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package me.mrdoc.twitchtopcheers.bot.listener; | ||
|
||
import me.mrdoc.twitchtopcheers.utils.PrintConsole; | ||
import org.pircbotx.hooks.ListenerAdapter; | ||
import org.pircbotx.hooks.events.ConnectAttemptFailedEvent; | ||
import org.pircbotx.hooks.events.ConnectEvent; | ||
import org.pircbotx.hooks.events.ServerResponseEvent; | ||
|
||
/** | ||
* Created on 24-07-2017 for TwitchGOTH_TOPSumCheers. | ||
* | ||
* @author Doc | ||
*/ | ||
public class GeneralListener extends ListenerAdapter { | ||
|
||
@Override | ||
public void onConnectAttemptFailed(ConnectAttemptFailedEvent event) { | ||
PrintConsole.sendError(event.toString()); | ||
System.exit(0); | ||
} | ||
|
||
@Override | ||
public void onServerResponse(ServerResponseEvent event) { | ||
if(event.getCode() == 446 || event.getCode() == 339) { | ||
PrintConsole.sendError("Error de conexion al canal IRC para trackear cheers. \nDetalles: " + event.getRawLine()); | ||
System.exit(0); | ||
} | ||
} | ||
|
||
@Override | ||
public void onConnect(ConnectEvent event) { | ||
PrintConsole.sendInfo("Servidor conectado correctamente."); | ||
event.respond("Conectado correctamente, trackeando envio de cheers."); | ||
} | ||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.