Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 1cfad1f

Browse files
authored
Merge pull request #13 from codeoverflow-org/feature/104-twitch-username
Add a method to the Twitch chat to get the username and ignore own messages
2 parents 3133d80 + 703cb61 commit 1cfad1f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/main/java/org/codeoverflow/chatoverflow/api/io/input/chat/TwitchChatInput.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,19 @@ default void registerChatMessageReceiveEventHandler(Consumer<TwitchChatMessageRe
4040
default void registerPrivateChatMessageReceiveEventHandler(Consumer<TwitchPrivateChatMessageReceiveEvent> eventHandler) {
4141
registerEventHandler(eventHandler, TwitchPrivateChatMessageReceiveEvent.class);
4242
}
43+
44+
/**
45+
* Returns the username of provided twitch account
46+
*
47+
* @return the twitch username of the bot
48+
*/
49+
String getUsername();
50+
51+
/**
52+
* Sets whether the messages from the provided twitch account should be ignored or not.
53+
* Note that this setting defaults to false.
54+
*
55+
* @param ignore whether the bot's own messages should be ignored
56+
*/
57+
void ignoreOwnMessages(boolean ignore);
4358
}

src/main/java/org/codeoverflow/chatoverflow/api/io/output/chat/TwitchChatOutput.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,11 @@ public interface TwitchChatOutput extends ChatOutput {
1717
* @param channel name of the channel
1818
*/
1919
void setChannel(String channel);
20+
21+
/**
22+
* Returns the username of provided twitch account
23+
*
24+
* @return the twitch username of the bot
25+
*/
26+
String getUsername();
2027
}

0 commit comments

Comments
 (0)