@Test @DisplayName("Local test to keep it running for debugging") @Disabled public void localTestRun() { List<ChannelMessageEvent> channelMessages = new ArrayList<>(); twitchChat.joinChannel("twitch4j"); twitchChat.getEventManager().onEvent(ChannelMessageEvent.class, event -> { log.debug(event.toString()); }); twitchChat.getEventManager().onEvent(CommandEvent.class, event -> { log.debug(event.toString()); }); TestUtils.sleepFor(120000); }
public void joinChannel(String channelName) { String lowerChannelName = channelName.toLowerCase(); channelCacheLock.lock(); try { if (currentChannels.add(lowerChannelName)) { sendCommand("join", "#" + lowerChannelName); log.debug("Joining Channel [{}].", lowerChannelName); } else { log.warn("Already joined channel {}", channelName); } } finally { channelCacheLock.unlock(); } }
TwitchChat implements AutoCloseable { public void joinChannel(String channelName) { String lowerChannelName = channelName.toLowerCase(); channelCacheLock.lock(); try { if (currentChannels.add(lowerChannelName)) { sendCommand("join", "#" + lowerChannelName); log.debug("Joining Channel [{}].", lowerChannelName); } else { log.warn("Already joined channel {}", channelName); } } finally { channelCacheLock.unlock(); } } }
TwitchChat implements AutoCloseable { public void joinChannel(String channelName) { String lowerChannelName = channelName.toLowerCase(); channelCacheLock.lock(); try { if (currentChannels.add(lowerChannelName)) { sendCommand("join", "#" + lowerChannelName); log.debug("Joining Channel [{}].", lowerChannelName); } else { log.warn("Already joined channel {}", channelName); } } finally { channelCacheLock.unlock(); } } TwitchChat(EventManager eventManager, CredentialManager credentialManager, OAuth2Credential chatCredential, String baseUrl, boolean sendCredentialToThirdPartyHost, List<String> commandPrefixes, Integer chatQueueSize, Bandwidth chatRateLimit, Bandwidth[] whisperRateLimit, ScheduledThreadPoolExecutor taskExecutor, long chatQueueTimeout, ProxyConfig proxyConfig, Collection<String> botOwnerIds); }
TwitchChat implements AutoCloseable { public void joinChannel(String channelName) { String lowerChannelName = channelName.toLowerCase(); channelCacheLock.lock(); try { if (currentChannels.add(lowerChannelName)) { sendCommand("join", "#" + lowerChannelName); log.debug("Joining Channel [{}].", lowerChannelName); } else { log.warn("Already joined channel {}", channelName); } } finally { channelCacheLock.unlock(); } } TwitchChat(EventManager eventManager, CredentialManager credentialManager, OAuth2Credential chatCredential, String baseUrl, boolean sendCredentialToThirdPartyHost, List<String> commandPrefixes, Integer chatQueueSize, Bandwidth chatRateLimit, Bandwidth[] whisperRateLimit, ScheduledThreadPoolExecutor taskExecutor, long chatQueueTimeout, ProxyConfig proxyConfig, Collection<String> botOwnerIds); @Synchronized void connect(); @Synchronized void disconnect(); @Synchronized void reconnect(); void sendRaw(String command); void joinChannel(String channelName); void leaveChannel(String channelName); void sendMessage(String channel, String message); @Unofficial void sendMessage(String channel, String message, String nonce, String replyMsgId); void sendMessage(String channel, String message, @Unofficial Map<String, Object> tags); void sendPrivateMessage(String targetUser, String message); void delete(String channel, String targetMsgId); void timeout(String channel, String user, Duration duration, String reason); void ban(String channel, String user, String reason); void unban(String channel, String user); void close(); boolean isChannelJoined(String channelName); @Deprecated List<String> getCurrentChannels(); Set<String> getChannels(); Map<String, String> getChannelIdToChannelName(); Map<String, String> getChannelNameToChannelId(); }
TwitchChat implements AutoCloseable { public void joinChannel(String channelName) { String lowerChannelName = channelName.toLowerCase(); channelCacheLock.lock(); try { if (currentChannels.add(lowerChannelName)) { sendCommand("join", "#" + lowerChannelName); log.debug("Joining Channel [{}].", lowerChannelName); } else { log.warn("Already joined channel {}", channelName); } } finally { channelCacheLock.unlock(); } } TwitchChat(EventManager eventManager, CredentialManager credentialManager, OAuth2Credential chatCredential, String baseUrl, boolean sendCredentialToThirdPartyHost, List<String> commandPrefixes, Integer chatQueueSize, Bandwidth chatRateLimit, Bandwidth[] whisperRateLimit, ScheduledThreadPoolExecutor taskExecutor, long chatQueueTimeout, ProxyConfig proxyConfig, Collection<String> botOwnerIds); @Synchronized void connect(); @Synchronized void disconnect(); @Synchronized void reconnect(); void sendRaw(String command); void joinChannel(String channelName); void leaveChannel(String channelName); void sendMessage(String channel, String message); @Unofficial void sendMessage(String channel, String message, String nonce, String replyMsgId); void sendMessage(String channel, String message, @Unofficial Map<String, Object> tags); void sendPrivateMessage(String targetUser, String message); void delete(String channel, String targetMsgId); void timeout(String channel, String user, Duration duration, String reason); void ban(String channel, String user, String reason); void unban(String channel, String user); void close(); boolean isChannelJoined(String channelName); @Deprecated List<String> getCurrentChannels(); Set<String> getChannels(); Map<String, String> getChannelIdToChannelName(); Map<String, String> getChannelNameToChannelId(); static final int REQUIRED_THREAD_COUNT; static final String TWITCH_WEB_SOCKET_SERVER; static final String FDGT_TEST_SOCKET_SERVER; }