Skip to content

Commit

Permalink
fix: use commandSource enum for the commandEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippHeuer committed Jan 12, 2019
1 parent 0fc2a6e commit 4ae854d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion chat/src/main/java/com/github/twitch4j/chat/TwitchChat.java
Expand Up @@ -3,6 +3,7 @@
import com.github.philippheuer.credentialmanager.CredentialManager;
import com.github.philippheuer.credentialmanager.domain.OAuth2Credential;
import com.github.philippheuer.events4j.EventManager;
import com.github.twitch4j.chat.enums.CommandSource;
import com.github.twitch4j.chat.enums.TMIConnectionState;
import com.github.twitch4j.chat.events.CommandEvent;
import com.github.twitch4j.chat.events.IRCEventHandler;
Expand Down Expand Up @@ -442,7 +443,7 @@ private void onChannelMessage(ChannelMessageEvent event) {
log.debug("Detected a command in channel {} with content: {}", event.getChannel().getName(), commandWithoutPrefix.get());

// dispatch command event
CommandEvent commandEvent = new CommandEvent("channel", event.getChannel().getName(), event.getUser(), prefix.get(), commandWithoutPrefix.get(), event.getPermissions());
CommandEvent commandEvent = new CommandEvent(CommandSource.CHANNEL, event.getChannel().getName(), event.getUser(), prefix.get(), commandWithoutPrefix.get(), event.getPermissions());
eventManager.dispatchEvent(commandEvent);
}
}
Expand Down
8 changes: 6 additions & 2 deletions docs/content/credentialmanager/_index.md
Expand Up @@ -7,9 +7,13 @@ weight = 10

If you use any module that reqires auth directly, you need to setup your credentialManager and pass it into the builder on the `.withCredentialManager(credentialManager)` method.

The setup requires the TwitchAuth Module to run to register the twitch identity provider within the credentialManager.
## Register the twitch identity provider using the AuthModule

## Example
```java

```

## Register the twitch identity provider manually

```java
CredentialManager credentialManager = CredentialManagerBuilder.builder().build();
Expand Down

0 comments on commit 4ae854d

Please sign in to comment.