From: Jordan Duabe <1442368+j4ckofalltrades@users.noreply.github.com> Date: Wed, 02 Jun 2021 21:19:55 +0530 Subject: Update Twitch actions to use latest action-api version --- Update Twitch actions to use latest action-api version --- --- 'a/twitch/add-stream-marker/src/main/java/addstreammarker/AddStreamMarkerAction.java' +++ b/twitch/add-stream-marker/src/main/java/addstreammarker/AddStreamMarkerAction.java @@ -6,7 +6,6 @@ import com.stream_pi.action_api.actionpr import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; import com.stream_pi.util.exception.MinorException; -import com.stream_pi.util.exception.StreamPiException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; --- 'a/twitch/host-channel/src/main/java/hostchannel/HostChannelAction.java' +++ b/twitch/host-channel/src/main/java/hostchannel/HostChannelAction.java @@ -6,7 +6,6 @@ import com.stream_pi.action_api.actionpr import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; import com.stream_pi.util.exception.MinorException; -import com.stream_pi.util.exception.StreamPiException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; --- 'a/twitch/raid-channel/src/main/java/raidchannel/RaidChannelAction.java' +++ b/twitch/raid-channel/src/main/java/raidchannel/RaidChannelAction.java @@ -6,7 +6,6 @@ import com.stream_pi.action_api.actionpr import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; import com.stream_pi.util.exception.MinorException; -import com.stream_pi.util.exception.StreamPiException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; --- 'a/twitch/send-channel-msg/src/main/java/sendchannelmsg/SendChannelMessageAction.java' +++ b/twitch/send-channel-msg/src/main/java/sendchannelmsg/SendChannelMessageAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -28,7 +28,7 @@ public class SendChannelMessageAction ex } @Override - public void initProperties() throws Exception + public void initProperties() throws MinorException { Property channelName = new Property(channelNameKey, Type.STRING); channelName.setDisplayName("Channel Name"); @@ -44,13 +44,7 @@ public class SendChannelMessageAction ex } @Override - public void initAction() throws Exception - { - - } - - @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -65,7 +59,7 @@ public class SendChannelMessageAction ex twirk.channelMessage(message); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to send channel message", String.format("Could not send message '%s' to '%s' channel, please try again.", channel, message) @@ -74,14 +68,14 @@ public class SendChannelMessageAction ex } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/set-color/src/main/java/setcolor/SetColorAction.java' +++ b/twitch/set-color/src/main/java/setcolor/SetColorAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -18,7 +18,7 @@ public class SetColorAction extends Norm private Twirk twirk; @Override - public void initProperties() throws Exception + public void initProperties() { setName("Set Color"); setCategory("Twitch Chat"); @@ -45,7 +45,7 @@ public class SetColorAction extends Norm } @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -60,7 +60,7 @@ public class SetColorAction extends Norm twirk.channelMessage(String.format("/color %s", color)); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to change username color", String.format("Could not change username color to '%s' for '%s' channel, please try again.", color, channel) @@ -69,14 +69,14 @@ public class SetColorAction extends Norm } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/slow-mode/src/main/java/slow_mode/SlowModeAction.java' +++ b/twitch/slow-mode/src/main/java/slow_mode/SlowModeAction.java @@ -8,7 +8,6 @@ import com.stream_pi.action_api.actionpr import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.ToggleAction; import com.stream_pi.util.exception.MinorException; -import com.stream_pi.util.exception.StreamPiException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -46,7 +45,7 @@ public class SlowModeAction extends Togg } @Override - public void onToggleOn() throws Exception + public void onToggleOn() throws MinorException { try { @@ -56,12 +55,12 @@ public class SlowModeAction extends Togg } catch (Exception ex) { setCurrentStatus(false); - throw new StreamPiException("Failed to enable slow mode.", "Please try again."); + throw new MinorException("Failed to enable slow mode.", "Please try again."); } } @Override - public void onToggleOff() throws Exception + public void onToggleOff() throws MinorException { try { @@ -70,7 +69,7 @@ public class SlowModeAction extends Togg } catch (Exception ex) { setCurrentStatus(true); - throw new StreamPiException("Failed to disable slow mode.", "Please try again."); + throw new MinorException("Failed to disable slow mode.", "Please try again."); } } @@ -108,13 +107,13 @@ public class SlowModeAction extends Togg twirk.connect(); } catch (Exception ex) { - throw new StreamPiException("Failed to connect to Twitch", + throw new MinorException("Failed to connect to Twitch", String.format("Could not connect to '%s' channel.", channel)); } } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { @@ -123,7 +122,7 @@ public class SlowModeAction extends Togg twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/start-commercial/src/main/java/startcommercial/StartCommercialAction.java' +++ b/twitch/start-commercial/src/main/java/startcommercial/StartCommercialAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -30,7 +30,7 @@ public class StartCommercialAction exten } @Override - public void initProperties() throws Exception + public void initProperties() throws MinorException { Property channelName = new Property(channelNameKey, Type.STRING); channelName.setDisplayName("Channel Name"); @@ -51,13 +51,7 @@ public class StartCommercialAction exten } @Override - public void initAction() throws Exception - { - - } - - @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -72,20 +66,20 @@ public class StartCommercialAction exten twirk.channelMessage(String.format("/commercial %s", duration)); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to start commercial", "Could not start commercial, please try again."); } } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/subs-only/src/main/java/subs_only/SubsOnlyAction.java' +++ b/twitch/subs-only/src/main/java/subs_only/SubsOnlyAction.java @@ -8,7 +8,6 @@ import com.stream_pi.action_api.actionpr import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.ToggleAction; import com.stream_pi.util.exception.MinorException; -import com.stream_pi.util.exception.StreamPiException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -42,7 +41,7 @@ public class SubsOnlyAction extends Togg } @Override - public void onToggleOn() throws Exception + public void onToggleOn() throws MinorException { try { @@ -51,12 +50,12 @@ public class SubsOnlyAction extends Togg } catch (Exception ex) { setCurrentStatus(false); - throw new StreamPiException("Failed to enable subscribers only mode.", "Please try again."); + throw new MinorException("Failed to enable subscribers only mode.", "Please try again."); } } @Override - public void onToggleOff() throws Exception + public void onToggleOff() throws MinorException { try { @@ -65,7 +64,7 @@ public class SubsOnlyAction extends Togg } catch (Exception ex) { setCurrentStatus(true); - throw new StreamPiException("Failed to disable subscribers only mode.", "Please try again."); + throw new MinorException("Failed to disable subscribers only mode.", "Please try again."); } } @@ -105,13 +104,13 @@ public class SubsOnlyAction extends Togg twirk.connect(); } catch (Exception ex) { - throw new StreamPiException("Failed to connect to Twitch", + throw new MinorException("Failed to connect to Twitch", String.format("Could not connect to '%s' channel.", channel)); } } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { @@ -120,7 +119,7 @@ public class SubsOnlyAction extends Togg twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/unhost/src/main/java/unhost/UnhostAction.java' +++ b/twitch/unhost/src/main/java/unhost/UnhostAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -27,7 +27,7 @@ public class UnhostAction extends Normal } @Override - public void initProperties() throws Exception + public void initProperties() throws MinorException { Property channel = new Property(channelNameKey, Type.STRING); channel.setDisplayName("Channel"); @@ -38,13 +38,7 @@ public class UnhostAction extends Normal } @Override - public void initAction() throws Exception - { - - } - - @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -58,21 +52,21 @@ public class UnhostAction extends Normal twirk.channelMessage("/unhost"); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to cancel channel hosting", "Could not cancel channel hosting, please try again."); } } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/unraid/src/main/java/unraid/UnraidAction.java' +++ b/twitch/unraid/src/main/java/unraid/UnraidAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -27,7 +27,7 @@ public class UnraidAction extends Normal } @Override - public void initProperties() throws Exception + public void initProperties() throws MinorException { Property channel = new Property(channelNameKey, Type.STRING); channel.setDisplayName("Channel"); @@ -38,13 +38,7 @@ public class UnraidAction extends Normal } @Override - public void initAction() throws Exception - { - - } - - @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -58,21 +52,21 @@ public class UnraidAction extends Normal twirk.channelMessage("/unraid"); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to cancel channel raid", "Could not cancel channel raid, please try again."); } } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } } --- 'a/twitch/whisper/src/main/java/whisper/WhisperAction.java' +++ b/twitch/whisper/src/main/java/whisper/WhisperAction.java @@ -5,7 +5,7 @@ import com.gikk.twirk.TwirkBuilder; import com.stream_pi.action_api.actionproperty.property.Property; import com.stream_pi.action_api.actionproperty.property.Type; import com.stream_pi.action_api.externalplugin.NormalAction; -import com.stream_pi.util.exception.StreamPiException; +import com.stream_pi.util.exception.MinorException; import com.stream_pi.util.version.Version; import connect.chat.TwitchChatCredentials; @@ -28,7 +28,7 @@ public class WhisperAction extends Norma } @Override - public void initProperties() throws Exception + public void initProperties() throws MinorException { Property usernameProp = new Property(usernameKey, Type.STRING); usernameProp.setDisplayName("Twitch Username"); @@ -44,13 +44,7 @@ public class WhisperAction extends Norma } @Override - public void initAction() throws Exception - { - - } - - @Override - public void onActionClicked() throws Exception + public void onActionClicked() throws MinorException { final TwitchChatCredentials.ChatCredentials credentials = TwitchChatCredentials.getCredentials(); credentials.ensureCredentialsInitialized(); @@ -65,7 +59,7 @@ public class WhisperAction extends Norma twirk.whisper(username, message); } catch (Exception ex) { - throw new StreamPiException( + throw new MinorException( "Failed to send message to user", String.format("Could not send message '%s' to user '%s', please try again.", username, message) @@ -74,14 +68,14 @@ public class WhisperAction extends Norma } @Override - public void onShutDown() throws Exception + public void onShutDown() throws MinorException { if (twirk != null) { try { twirk.disconnect(); } catch (Exception ex) { - throw new StreamPiException("Twitch connection error", "Please try again."); + throw new MinorException("Twitch connection error", "Please try again."); } } }