-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
150 lines (104 loc) · 5.69 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html>
<head>
<title>Default Bot</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, target-densitydpi=160dpi, initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div id="container">
<div id="background"></div>
<ul class="sections">
<li id="section-1">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-1">¶</a>
</div>
<h1 id="default-bot">Default Bot</h1>
<h1 id="summary">Summary</h1>
<p>This bot is just like an ‘under construction’ page for a website. Until
a better bot can be installed here, this one will take the message and
forward it to the owner of the account. It has no settings.</p>
<h1 id="installation">Installation</h1>
<p>This bot can be installed on any GreenBot server through the web UI, or
by through the command line at the greenbot-core root with a
a ‘npm install default-bot’</p>
<p>This bot requires a ruby installation, 2.0 or older</p>
<h1 id="annoated-bot-code">Annoated Bot Code</h1>
<h2 id="full-source-in-git-repo">Full source in git repo</h2>
<p>./lib/greenbot.rb is a convenience library for IO. Used for note, confirm..</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">require</span> <span class="hljs-string">'./lib/greenbot.rb'</span>
<span class="hljs-keyword">require</span> <span class="hljs-string">'timeout'</span></pre></div></div>
</li>
<li id="section-2">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-2">¶</a>
</div>
<p>Ask user if they want us to contact the owner of the bot</p>
</div>
<div class="content"><div class='highlight'><pre>tell <span class="hljs-string">'Thank you for texting us. This KISST bot is currently under construction. If you are looking for the owner of this number, I can take a message.'</span>
<span class="hljs-keyword">if</span> confirm(<span class="hljs-string">'Would you like someone to contact you?'</span>)</pre></div></div>
</li>
<li id="section-3">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">¶</a>
</div>
<p>If so, set the contact me to true and save it in the collected data</p>
</div>
<div class="content"><div class='highlight'><pre> contact_me = <span class="hljs-literal">true</span>
contact_me.remember(<span class="hljs-string">'contact_me'</span>)</pre></div></div>
</li>
<li id="section-4">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-4">¶</a>
</div>
<p>Ask for the persons name, and remember it.</p>
</div>
<div class="content"><div class='highlight'><pre> name = ask(<span class="hljs-string">'When we call, who should we ask for?'</span>)
name.remember(<span class="hljs-string">'who_to_ask_for'</span>)</pre></div></div>
</li>
<li id="section-5">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-5">¶</a>
</div>
<p>Ask for another number, collect it if you can.</p>
</div>
<div class="content"><div class='highlight'><pre> <span class="hljs-keyword">if</span> confirm(<span class="hljs-string">'Is there another number we should try?'</span>)
better_number = ask(<span class="hljs-string">'Please enter that number with an area code'</span>)
better_number.remember(<span class="hljs-string">'better_number'</span>)
<span class="hljs-keyword">end</span>
<span class="hljs-keyword">end</span></pre></div></div>
</li>
<li id="section-6">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-6">¶</a>
</div>
<p>Ask if they want us to take a message for hte owner. Use the note
function so we can take multiple messages.</p>
</div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">if</span> confirm(<span class="hljs-string">'Would you like to leave a message?'</span>)
note = note(<span class="hljs-string">'How can we help you? Please use as many messages as you need.'</span>)
note.remember(<span class="hljs-string">'note'</span>)
tell <span class="hljs-string">'Thank you. We will forward the message.'</span>
<span class="hljs-keyword">end</span></pre></div></div>
</li>
<li id="section-7">
<div class="annotation">
<div class="pilwrap ">
<a class="pilcrow" href="#section-7">¶</a>
</div>
<p>And that’s it. Say good bye</p>
</div>
<div class="content"><div class='highlight'><pre>tell <span class="hljs-string">'Goodbye.'</span></pre></div></div>
</li>
</ul>
</div>
</body>
</html>