本文整理汇总了Java中com.google.code.chatterbotapi.ChatterBotFactory类的典型用法代码示例。如果您正苦于以下问题:Java ChatterBotFactory类的具体用法?Java ChatterBotFactory怎么用?Java ChatterBotFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ChatterBotFactory类属于com.google.code.chatterbotapi包,在下文中一共展示了ChatterBotFactory类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGui
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
@Override
public void initGui()
{
this.reponse = this.getRandomString();
this.textfield = new GuiTextField(this.fontRendererObj, this.width / 2 - 150, 50, 300, 20);
this.textfield.setMaxStringLength(300);
this.textfield.setFocused(true);
this.factory = new ChatterBotFactory();
try {
this.bot = this.factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
this.bot_session = this.bot.createSession();
} catch (Exception e) {
e.printStackTrace();
}
this.buttonList.add(new GuiButton(42, this.width / 4, this.height - 40, this.width / 2, 20, ChatColor.RESET + "Say"));
}
示例2: PrivateMessageChatThread
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public PrivateMessageChatThread(MessageChannel messageChannel, JDA jda, User user, Message firstMessage, Map<User, PrivateMessageChatThread> chatThreadMap) {
super(messageChannel, jda, user);
this.threadsMap = chatThreadMap;
this.botFactory = new ChatterBotFactory();
this.active = true;
this.user = user;
createBotSessions();
if (firstMessage == null) messageChannel.sendMessage("Hey, wanna talk?");
else setScannedMessaged(firstMessage);
jda.addEventListener(this);
chatThreadMap.put(user, this);
}
示例3: createClever
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
private ChatterBot createClever() {
try {
return new ChatterBotFactory()
.create(ChatterBotType.CLEVERBOT, sentryProperties.getDiscord().getCleverBotApiKey());
} catch (Exception e) {
log.warn("Could not create CleverBot session", e);
}
return null;
}
示例4: CleverBotListener
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverBotListener(JDA jda) {
this.jda = jda;
this.botFactory = new ChatterBotFactory();
createBotSessions();
jda.addEventListener(this);
}
示例5: CleverbotSession
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverbotSession() throws Exception
{
JSONObject json = new JSONObject(Util.getFileContents("config.json"));
ChatterBotFactory factory = new ChatterBotFactory();
ChatterBot bot = factory.create(ChatterBotType.CLEVERBOT, json.getString("cleverbotAPIKey"));
session = bot.createSession(Locale.ENGLISH);
}
示例6: init
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public boolean init() {
try {
factory = new ChatterBotFactory();
// chatterbot = factory.create(type);
chatterbot = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
// chatterbot = factory.create(ChatterBotType.CLEVERBOT);
session = chatterbot.createSession();
} catch (Exception e) {
Logging.logError(e);
}
return true;
}
示例7: CommandCleverbot
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CommandCleverbot() {
try {
bot = new ChatterBotFactory().create(ChatterBotType.CLEVERBOT).createSession();
} catch (Exception e) {
e.printStackTrace();
}
}
示例8: init
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public boolean init() {
try {
factory = new ChatterBotFactory();
// chatterbot = factory.create(type);
chatterbot = factory.create(ChatterBotType.PANDORABOTS, "b0dafd24ee35a477");
// chatterbot = factory.create(ChatterBotType.CLEVERBOT);
session = chatterbot.createSession();
} catch (Exception e) {
Logging.logError(e);
}
return true;
}
示例9: ChatBot
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public ChatBot() {
factory = new ChatterBotFactory();
try {
bot = factory.create(ChatterBotType.CLEVERBOT);
} catch (Exception e) {
e.printStackTrace();
}
session = bot.createSession();
}
示例10: run
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public void run() {
Thread.currentThread().setName("ChatterBot");
try {
ChatterBotFactory factory = new ChatterBotFactory();
com.google.code.chatterbotapi.ChatterBot bot1 = factory.create(ChatterBotType.CLEVERBOT);
ChatterBotSession bot1session = bot1.createSession();
while (isRunning) while (UserAnswered) {
s = bot1session.think(s);
UserAnswered = false;
Chat.unlockWaiter();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例11: CleverbotCommand
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public CleverbotCommand(Charrizard charrizard) {
super("clever", "Talk with CleverBot");
this.charrizard = charrizard;
this.factory = new ChatterBotFactory();
this.chatterBotSessionCache = CacheBuilder.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES).build();
}
示例12: getChatFactory
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
protected static ChatterBotFactory getChatFactory() {
return chatFactory;
}
示例13: ChatBot
import com.google.code.chatterbotapi.ChatterBotFactory; //导入依赖的package包/类
public ChatBot() {
super("ChatBot", "Chat AI", false);
factory = new ChatterBotFactory();
}