김연준

Help function add detail

......@@ -10,8 +10,8 @@ message_recieved = 0;
exports.startbot = ()=>{
// Get authorization to use the slackbot
const bot = new SlackBot({
token : "xoxb-582582124755-587875604934-gdWsVhzGXCze3mECWXpTsAP6",
name : "joker"
token : "Your Token",
name : "jokebot"
});
// Start the slackbot
......@@ -22,7 +22,7 @@ exports.startbot = ()=>{
channel_length = data.channels.length;
for(i=0; i< channel_length; ++i){
//postMessageToChannel(name, message [, params, callback]) (return: promise) - posts a message to channel by name.
bot.postMessageToChannel(data.channels[i].name, 'Have some fun with @Joker!\nFor commands write @joker --help',
bot.postMessageToChannel(data.channels[i].name, 'Have some fun with @Joker!\nFor commands write @jokebot --help',
emoji.emojis('bowtie'));
}
return data;
......@@ -107,11 +107,11 @@ function handleMessage(message, current_channel){
else if(message.includes(' funny story')){
Funnystory(current_channel);
}
else if(message.includes(' userjoke')){
else if(message.includes(' my joke') || message.includes(' myjoke')){
UserMakeJoke(message,current_channel);
}
else if(message.includes(' me')){
comment = "Please use @joker --help to know what I can do!:smile::smile::smile:\n You can write type of joke[knock-knock, general, programming, funny story, reddit]";
comment = "Please use @jokebot --help to know what I can do!:smile::smile::smile:\n You can write type of joke[knock-knock, general, programming, funny story, reddit]";
bot.postMessageToChannel(current_channel, "Tell you what??? :no_mouth:", emoji.emojis('no_mouth'));
bot.postMessageToChannel(current_channel, comment, emoji.emojis('flushed'));
}
......@@ -175,7 +175,7 @@ function MakeJoke(message,user_channel){
});
}
});
comment="Sucess making joke!!:+1::thumbsup:\nWhen you want to show your joke, please enter @jokebot tell-me-userjoke";
comment="Sucess making joke!!:+1::thumbsup:\nWhen you want to show your joke, please enter @jokebot tell-me-my-joke";
bot.postMessageToChannel(user_channel,`${comment}:kissing_heart:`,emoji.emojis('nerd_face'));
}
else{
......@@ -427,8 +427,9 @@ knockknockJoke= (user_channel)=>{
//Function for giving out information to user to control the bot
runHelp = (user_channel) =>{
comment = "Thanks for using Joker bot!:ghost::ghost:laugh:\nBot info: type '@joker help' for infos\nBot functions: '@joker tell-me [something] joke' will send related jokes, if I don't have what you mentioned, I will tell you I don't have that joke:smile:\n"
current_jokes = "Joke types I have: 1)general , 2)knock-knock , 3)programming , 4)reddit, 5)funny story, 6)make joke 7)userjoke"
bot.postMessageToChannel(user_channel, comment + current_jokes ,emoji.emojis('question'));
comment = "Thanks for using jokebot bot!:ghost::ghost:laugh:\nBot info: type '@jokebot help' for infos\nBot functions: '@jokebot tell-me [something] joke' will send related jokes, if I don't have what you mentioned, I will tell you I don't have that joke:smile:\n"
current_jokes = "Joke types I have: 1)general , 2)knock-knock , 3)programming , 4)reddit, 5)funny story:laughing:\n";
ownJoke = "Wanna add your own joke? Just type '@jokebot [make joke : (question), (your joke)]' ! Want to check what jokes you added? Just simply type '@jokebot tell me my joke:smiley:'";
bot.postMessageToChannel(user_channel, comment + current_jokes + ownJoke ,emoji.emojis('question'));
}
}
......