Class: Chatterbot::Bot
- Inherits:
-
Object
- Object
- Chatterbot::Bot
- Includes:
- Blacklist, Client, Config, DB, Favorite, Followers, Helpers, Logging, Profile, Reply, Retweet, Search, Streaming, Tweet, UI, Utils
- Defined in:
- lib/chatterbot/bot.rb
Overview
primary Bot object, includes all the other modules
Constant Summary
Constants included from Config
Instance Attribute Summary
Attributes included from Client
#client, #screen_name, #search_client, #streaming_client
Attributes included from Config
Attributes included from Blacklist
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Bot
constructor
Create a new bot.
Methods included from Helpers
#botname, #botname=, #from_user, #replace_variables, #tweet_user
Methods included from DB
#db, #display_db_config_notice
Methods included from Client
#base_url, #consumer, #default_opts, #generate_authorize_url, #get_screen_name, #init_client, #login, #request_token, #require_login, #reset!, #reset_client, #reset_since_id, #reset_since_id_reply
Methods included from UI
#display_oauth_error, #get_api_key, #get_oauth_verifier
Methods included from Followers
Methods included from Reply
Methods included from Favorite
Methods included from Retweet
Methods included from Profile
#profile_text, #profile_website
Methods included from Tweet
Methods included from Search
Methods included from Logging
Methods included from Config
#bot_config, #chatterbot_helper?, #client_params, #config_file, #config_to_save, #db_config, #debug_mode=, #debug_mode?, #global_config, #global_config_files, #has_config?, #has_db?, #has_sequel?, #load_config, #log_dest, #log_tweets?, #logging?, #max_id_from, #needs_api_key?, #needs_auth_token?, #no_update=, #reset_bot?, #since_id, #since_id=, #since_id_reply, #since_id_reply=, #slurp_file, #store_database_config, #store_local_config, #update_config, #update_config?, #update_config_at_exit, #update_since_id, #update_since_id_reply, #verbose=, #verbose?, #working_dir
Methods included from Streaming
#authenticated_user, #do_streaming, #handle_streaming_object
Methods included from Blacklist
#add_to_blacklist, #on_blacklist?, #on_global_blacklist?, #skip_me?
Methods included from Utils
Constructor Details
#initialize(params = {}) ⇒ Bot
Create a new bot. No options for now.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/chatterbot/bot.rb', line 25 def initialize(params={}) if params.has_key?(:name) @botname = params.delete(:name) end @config = load_config(params) if reset_bot? reset_since_id update_config puts "Reset to #{@config[:since_id]}" exit else # update config when we exit at_exit do raise $! if $! update_config_at_exit end end end |