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-25 17:45:49 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9ea1990c4a82c9e28898af27f74f640e7e690e44
9ea1990c
1 parent
c4d67d07
Building callback function to ensure code execution order
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
index.js
index.js
View file @
9ea1990
...
...
@@ -7,7 +7,7 @@ const MongoClient = require('mongodb').MongoClient;
const
url
=
'mongodb://localhost:27017/'
;
const
bot
=
new
SlackBot
({
token
:
"xoxb-582582124755-587875604934-
EWnGacmzNvfVQk2XvhteoIzw
"
,
token
:
"xoxb-582582124755-587875604934-
mceAxq9E58uHT4WRkqSbcibU
"
,
name
:
"Joker"
});
...
...
@@ -80,13 +80,23 @@ randomJoke= ()=>{
const
face
=
{
icon_emoji
:
':laughing:'
};
function
firstFunction
(
channel
){
bot
.
postMessageToChannel
(
channel
,
joke
,
face
);
console
.
log
(
"허무개그 전송~~~~!"
);
}
bot
.
postMessageToChannel
(
'everyone'
,
joke
,
face
);
bot
.
postMessageToChannel
(
'full-stack-web'
,
joke
,
face
);
bot
.
postMessageToChannel
(
'bot_test'
,
joke
,
face
);
bot
.
postMessageToChannel
(
'everyone'
,
question
,
face
);
bot
.
postMessageToChannel
(
'full-stack-web'
,
question
,
joke
,
face
);
bot
.
postMessageToChannel
(
'bot_test'
,
question
,
face
);
function
secondFunction
(
channel
,
callback
){
bot
.
postMessageToChannel
(
channel
,
question
,
face
);
console
.
log
(
"질문 불려짐"
)
firstFunction
(
channel
);
}
secondFunction
(
'everyone'
,
firstFunction
);
// bot.postMessageToChannel('everyone', question, face);
// bot.postMessageToChannel('full-stack-web', question, joke, face);
// bot.postMessageToChannel('bot_test', question, face);
// bot.postMessageToChannel('everyone', joke, face);
// bot.postMessageToChannel('full-stack-web', joke, face);
// bot.postMessageToChannel('bot_test', joke, face);
})
client
.
close
();
})
...
...
Please
register
or
login
to post a comment