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-24 19:24:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4941acb3c87722f5ccc1136d2c6685b98973c926
4941acb3
1 parent
b39548a1
Slight fixes of mongo.js file
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
index.js
mongo.js
index.js
View file @
4941acb
...
...
@@ -36,31 +36,31 @@ bot.on('message', (data) => {
function
handleMessage
(
message
){
if
(
message
.
includes
(
'chucknorris'
)){
route
.
chuckJoke
()
.
then
((
err
,
res
)
=>
{
.
then
((
err
,
data
)
=>
{
if
(
err
)
throw
err
;
res
(
"ChuckJoke function activated"
);
console
.
log
(
"ChuckJoke function activated"
);
});
}
else
if
(
message
.
includes
(
' yomama'
)){
route
.
yoMamaJoke
()
.
then
((
err
,
res
)
=>
{
.
then
((
err
,
data
)
=>
{
if
(
err
)
throw
err
;
res
(
"yoMamaJoke function activated"
);
console
.
log
(
"yoMamaJoke function activated"
);
});
}
else
if
(
message
.
includes
(
' random'
)){
route
.
randomJoke
()
.
then
((
err
,
res
)
=>
{
if
(
err
)
throw
err
res
(
"randomJoke function activated"
);
.
then
((
err
,
data
)
=>
{
if
(
err
)
throw
err
;
console
.
log
(
"randomJoke function activated"
);
});
}
else
if
(
message
.
includes
(
' help'
)){
route
.
runHelp
()
.
then
((
err
,
res
)
=>
{
if
(
err
)
throw
err
res
(
" function activated"
);
.
then
((
err
,
data
)
=>
{
if
(
err
)
throw
err
;
console
.
log
(
" function activated"
);
});
}
}
\ No newline at end of file
...
...
mongo.js
View file @
4941acb
...
...
@@ -26,9 +26,12 @@ var url = "mongodb://localhost:27017/jokeapi";
// });
// });
//
MongoClient
.
connect
(
url
).
then
((
client
)
=>
{
console
.
log
(
'Connected correctly to server'
);
}).
catch
((
err
)
=>
console
.
log
(
err
));
/*
const db = client.db(dbname);
dboperation.insertDocument(db, jokedoc, collec)
...
...
@@ -40,4 +43,4 @@ MongoClient.connect(url).then((client) => {
.catch((err) => console.log(err));
})
.
catch
((
err
)
=>
console
.
log
(
err
));
\ No newline at end of file
*/
\ No newline at end of file
...
...
Please
register
or
login
to post a comment