Skip to content

Commit

Permalink
fix provider imports (refs xatkit-bot-platform/xatkit-runtime#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaniel committed Sep 3, 2019
1 parent 3636163 commit 408c063
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package com.xatkit.plugins.discord.platform.io;

import com.xatkit.core.platform.io.RuntimeIntentProvider;
import com.xatkit.plugins.discord.platform.DiscordPlatform;
import org.apache.commons.configuration2.Configuration;

/**
* A generic Discord user {@link RuntimeIntentProvider}.
* A generic Discord user {@link com.xatkit.plugins.chat.platform.io.ChatIntentProvider}.
* <p>
* This class wraps the {@link DiscordIntentProvider} and allows to use it as a generic <i>ChatProvider</i> from the
* <i>ChatPlatform</i>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.xatkit.plugins.discord.platform.io;

import com.xatkit.core.platform.io.RuntimeIntentProvider;
import com.xatkit.plugins.chat.platform.io.ChatIntentProvider;
import com.xatkit.plugins.discord.DiscordUtils;
import com.xatkit.plugins.discord.platform.DiscordPlatform;
import com.xatkit.plugins.chat.platform.io.ChatIntentProvider;
import fr.inria.atlanmod.commons.log.Log;
import net.dv8tion.jda.core.JDA;
import org.apache.commons.configuration2.Configuration;
Expand All @@ -13,7 +12,7 @@
import static java.util.Objects.nonNull;

/**
* A Discord user {@link RuntimeIntentProvider}.
* A Discord user {@link ChatIntentProvider}.
* <p>
* This class relies on the <a href="https://github.com/DV8FromTheWorld/JDA">JDA library</a> to receive direct
* messages and react to them. Note that this input provider only captures direct messages (sent in private channels)
Expand All @@ -24,7 +23,7 @@
* receive messages through the JDA client.
*
* @see DiscordUtils
* @see RuntimeIntentProvider
* @see ChatIntentProvider
*/
public class DiscordIntentProvider extends ChatIntentProvider<DiscordPlatform> {

Expand Down Expand Up @@ -53,7 +52,7 @@ public class DiscordIntentProvider extends ChatIntentProvider<DiscordPlatform> {
* bot token.
*
* @param runtimePlatform the {@link DiscordPlatform} containing this {@link DiscordIntentProvider}
* @param configuration the {@link Configuration} used to retrieve the Discord bot token
* @param configuration the {@link Configuration} used to retrieve the Discord bot token
* @throws NullPointerException if the provided {@code runtimePlatform} or {@code configuration} is {@code
* null}
* @throws IllegalArgumentException if the provided Discord bot token is {@code null} or empty
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xatkit.plugins.discord.platform.io;

import com.xatkit.core.XatkitCore;
import com.xatkit.core.platform.io.IntentRecognitionHelper;
import com.xatkit.core.session.XatkitSession;
import com.xatkit.intent.RecognizedIntent;
import com.xatkit.plugins.chat.ChatUtils;
Expand Down Expand Up @@ -93,7 +94,8 @@ public void onPrivateMessageReceived(PrivateMessageReceivedEvent event) {
* Call getRecognizedIntent before setting any context variable, the recognition triggers a decrement of all
* the context variables.
*/
RecognizedIntent recognizedIntent = discordIntentProvider.getRecognizedIntent(content, xatkitSession);
RecognizedIntent recognizedIntent = IntentRecognitionHelper.getRecognizedIntent(content, xatkitSession,
xatkitCore);
/*
* The discord-related values are stored in the local context with a lifespan count of 1: they are reset
* every time a message is received, and may cause consistency issues when using multiple IntentProviders.
Expand Down

0 comments on commit 408c063

Please sign in to comment.