Example #1
0
        private ChatterBotSession CreateSession(ChatterBotType type)
        {
            if (!bots.ContainsKey(type))
                bots.Add(type, factory.Create(type, "d689f7b8de347251"));

            return bots[type].CreateSession();
        }
Example #2
0
        public static ChatterBot Create(ChatterBotType type, object arg)
        {
#if GLOBAL_NADEKO
            var url = "http://www.cleverbot.com/webservicemin?uc=777&botapi=nadekobot";
#else
            var url = "http://www.cleverbot.com/webservicemin?uc=777&botapi=chatterbotapi";
#endif

            switch (type)
            {
            case ChatterBotType.CLEVERBOT:
                return(new Cleverbot("http://www.cleverbot.com/", url, 26));

            case ChatterBotType.JABBERWACKY:
                return(new Cleverbot("http://jabberwacky.com", "http://jabberwacky.com/webservicemin", 20));

            case ChatterBotType.PANDORABOTS:
                if (arg == null)
                {
                    throw new ArgumentException("PANDORABOTS needs a botid arg", nameof(arg));
                }
                return(new Pandorabots(arg.ToString()));
            }
            return(null);
        }
Example #3
0
 public ChatterBot Create(ChatterBotType type, object arg)
 {
     switch (type)
     {
     case ChatterBotType.CLEVERBOT:
         return(new Cleverbot("http://cleverbot.com/webservicemin"));
     }
     return(null);
 }
Example #4
0
        private void ChangeBot(string user, ChatterBotType type)
        {
            user = user.ToLower();

            if (!conversations.ContainsKey(user))
                conversations.Add(user, new ConversationState(this, type));
            else
                conversations[user] = new ConversationState(this, type);
        }
		public ChatterBot Create(ChatterBotType type, object arg) {
			switch (type) {
			case ChatterBotType.CLEVERBOT:
				return new Cleverbot("http://www.cleverbot.com/webservicemin", 26);
			case ChatterBotType.JABBERWACKY:
				return new Cleverbot("http://jabberwacky.com/webservicemin", 20);
			case ChatterBotType.PANDORABOTS:
				if (arg == null) throw new ApplicationException("PANDORABOTS needs a botid arg");
				return new Pandorabots(arg.ToString());
			}
			return null;
		}
Example #6
0
        public static ChatterBot Create(ChatterBotType type, object arg)
        {
            switch (type)
            {
            case ChatterBotType.CLEVERBOT:
                return(new Cleverbot("http://www.cleverbot.com/", "http://www.cleverbot.com/webservicemin?uc=321", 26));

            case ChatterBotType.JABBERWACKY:
                return(new Cleverbot("http://jabberwacky.com", "http://jabberwacky.com/webservicemin", 20));

            case ChatterBotType.PANDORABOTS:
                if (arg == null)
                {
                    throw new ArgumentException("PANDORABOTS needs a botid arg", nameof(arg));
                }
                return(new Pandorabots(arg.ToString()));
            }
            return(null);
        }
Example #7
0
        private bool TryConvert(string name, out ChatterBotType type)
        {
            name = name.ToLower();

            if (name == "clever" || name == "cleverbot")
            {
                type = ChatterBotType.CLEVERBOT;
                return true;
            }

            if (name == "pandora" || name == "pandorabot" || name == "pandorabots")
            {
                type = ChatterBotType.PANDORABOTS;
                return true;
            }

            type = ChatterBotType.CLEVERBOT;
            return false;
        }
Example #8
0
        public IChatterBot Create(ChatterBotType type, object arg)
        {
            switch (type)
            {
            case ChatterBotType.Cleverbot:
                return(new Cleverbot("http://www.cleverbot.com/webservicemin", 26));

            case ChatterBotType.Jabberwacky:
                return(new Cleverbot("http://jabberwacky.com/webservicemin", 20));

            case ChatterBotType.Pandorabots:
                if (arg == null)
                {
                    throw new ApplicationException("PANDORABOTS needs a botid arg");
                }
                return(new Pandorabots(arg.ToString()));
            }
            return(null);
        }
Example #9
0
 public ChatterBot Create(ChatterBotType type, object arg)
 {
     switch (type)
     {
         case ChatterBotType.CLEVERBOT:
             return new Cleverbot("http://cleverbot.com/webservicemin");
         case ChatterBotType.JABBERWACKY:
             return new Cleverbot("http://jabberwacky.com/webservicemin");
     }
     return null;
 }
Example #10
0
 public ChatterBot Create(ChatterBotType type)
 {
     return Create(type, null);
 }
Example #11
0
 public static ChatterBot Create(ChatterBotType type)
 {
     return(Create(type, null));
 }
Example #12
0
 static ChatterBotSession CreateBotSession(ChatterBotType type) => new ChatterBotFactory().Create(type).CreateSession();
Example #13
0
 public ConversationState(Chatbot bot, ChatterBotType type)
 {
     botType = type;
     session = bot.CreateSession(type);
     this.bot = bot;
 }