Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김민욱
/
Slack Jokebot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
1
Network
Create a new issue
Commits
Issue Boards
Authored by
김연준
2019-05-27 18:12:59 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
100e477ee2450140721226cabe3b98a1207a486f
100e477e
1 parent
97a66d82
Fixing looping problem- Still not fixed 100%
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
Routers/route.js
Routers/route.js
View file @
100e477
...
...
@@ -203,17 +203,17 @@ programmingJoke= ()=>{
})
client
.
close
();
})
}
}
;
knockknockJoke
=
()
=>
{
MongoClient
.
connect
(
url
,
function
(
err
,
client
){
MongoClient
.
connect
(
url
,
function
(
err
,
client
){
if
(
err
)
throw
err
;
var
db
=
client
.
db
(
'jokeapi'
);
json_max
=
376
;
json_max
=
61
;
function
getRandomInt
()
{
min
=
Math
.
ceil
(
1
);
max
=
Math
.
floor
(
376
);
max
=
Math
.
floor
(
json_max
);
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
+
1
))
+
min
;
}
random
=
getRandomInt
();
...
...
@@ -232,7 +232,7 @@ knockknockJoke= ()=>{
}
else
if
(
total
.
type
!=
"knock-knock"
){
client
.
close
();
programming
Joke
();
knockknock
Joke
();
}
// bot.postMessageToChannel('everyone', question, face);
...
...
@@ -245,14 +245,13 @@ knockknockJoke= ()=>{
.
then
((
joke_info
)
=>
{
function
askQuestion
(){
bot
.
postMessageToChannel
(
joke_info
[
3
],
joke_info
[
0
],
joke_info
[
2
]);
console
.
log
(
"
프로그래밍
질문 불려짐"
);
console
.
log
(
"
똑똑
질문 불려짐"
);
}
askQuestion
();
return
joke_info
;
})
.
then
((
info
)
=>
{
bot
.
postMessageToChannel
(
info
[
3
],
info
[
1
],
info
[
2
]);
return
;
})
client
.
close
();
})
...
...
Please
register
or
login
to post a comment