Module: Chatterbot::Profile

Included in:
Bot
Defined in:
lib/chatterbot/profile.rb

Overview

routines for managing your profile

Instance Method Summary collapse

Instance Method Details

#profile_text(p = nil) ⇒ Object

get/set the profile description


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/chatterbot/profile.rb', line 9

def profile_text(p=nil)
  return if  == false

  if p.nil?
    client.user.description
  else
    data = {
      description: p
    }
    client.update_profile(data)
    p
  end
end

#profile_website(w = nil) ⇒ Object

get/set the profile URL


26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/chatterbot/profile.rb', line 26

def profile_website(w=nil)
  return if  == false

  if w.nil?
    client.user.website
  else
    data = {
      url: w
    }
    client.update_profile(data)
    w
  end
end