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-28 15:49:48 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f4531dde8ba53c981691612935fae95dd7edbe06
f4531dde
1 parent
096ad4b6
Update README
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
README.md
Routers/route.js
README.md
View file @
f4531dd
<h1>
Building a Slackbot
</h1><br>
<h2>
A slackbot that reacts to user's chat
</h2><br>
<h2>
A slackbot that reacts to user's chat
and sends jokes
</h2><br>

\ No newline at end of file
...
...
Routers/route.js
View file @
f4531dd
...
...
@@ -7,7 +7,7 @@ const url = 'mongodb://localhost:27017/';
exports
.
startbot
=
()
=>
{
// Get authorization to use the slackbot
const
bot
=
new
SlackBot
({
token
:
"xoxb-582582124755-587875604934-
oewQRL6lzHXLkybUrg4CWJVJ
"
,
token
:
"xoxb-582582124755-587875604934-
YBMZlb18wIdKQIEpyIV2dORa
"
,
name
:
"Joker"
});
...
...
@@ -16,8 +16,8 @@ exports.startbot = ()=>{
const
face
=
{
icon_emoji
:
':bowtie:'
};
bot
.
postMessageToChannel
(
'everyone'
,
'Have some fun with @Joker!\nFor commands write @joker help'
,
face
);
bot
.
postMessageToChannel
(
'everyone'
,
'Have some fun with @Joker!\nFor commands write @joker
--
help'
,
face
,
'/play secret'
);
});
// Error Handler
bot
.
on
(
'error'
,
(
err
)
=>
console
.
log
(
err
));
...
...
@@ -55,7 +55,7 @@ function handleMessage(message, channel, user){
else
if
(
message
.
includes
(
' programming'
)){
programmingJoke
();
}
else
if
(
message
.
includes
(
' me
'
)){
else
if
(
message
.
includes
(
' me '
)){
bot
.
postMessageToChannel
(
'everyone'
,
"Tell you what??? :nomouth:"
,
embarrased
);
}
else
{
...
...
@@ -133,7 +133,7 @@ randomJoke= ()=>{
icon_emoji
:
':laughing:'
};
setTimeout
(
function
secondFunction
(){
bot
.
postMessageToChannel
(
'everyone'
,
`
${
joke
}
:stuck_out_tongue_winking_eye::laughing:`
,
face
)
bot
.
postMessageToChannel
(
'everyone'
,
`
${
joke
}
:stuck_out_tongue_winking_eye::laughing:`
,
face
,
'/play secret'
)
console
.
log
(
"허무개그 전송~~~~!"
)
},
3000
);
...
...
Please
register
or
login
to post a comment