Showing
1 changed file
with
10 additions
and
9 deletions
... | @@ -10,8 +10,8 @@ message_recieved = 0; | ... | @@ -10,8 +10,8 @@ message_recieved = 0; |
10 | exports.startbot = ()=>{ | 10 | exports.startbot = ()=>{ |
11 | // Get authorization to use the slackbot | 11 | // Get authorization to use the slackbot |
12 | const bot = new SlackBot({ | 12 | const bot = new SlackBot({ |
13 | - token : "xoxb-582582124755-587875604934-gdWsVhzGXCze3mECWXpTsAP6", | 13 | + token : "Your Token", |
14 | - name : "joker" | 14 | + name : "jokebot" |
15 | }); | 15 | }); |
16 | 16 | ||
17 | // Start the slackbot | 17 | // Start the slackbot |
... | @@ -22,7 +22,7 @@ exports.startbot = ()=>{ | ... | @@ -22,7 +22,7 @@ exports.startbot = ()=>{ |
22 | channel_length = data.channels.length; | 22 | channel_length = data.channels.length; |
23 | for(i=0; i< channel_length; ++i){ | 23 | for(i=0; i< channel_length; ++i){ |
24 | //postMessageToChannel(name, message [, params, callback]) (return: promise) - posts a message to channel by name. | 24 | //postMessageToChannel(name, message [, params, callback]) (return: promise) - posts a message to channel by name. |
25 | - bot.postMessageToChannel(data.channels[i].name, 'Have some fun with @Joker!\nFor commands write @joker --help', | 25 | + bot.postMessageToChannel(data.channels[i].name, 'Have some fun with @Joker!\nFor commands write @jokebot --help', |
26 | emoji.emojis('bowtie')); | 26 | emoji.emojis('bowtie')); |
27 | } | 27 | } |
28 | return data; | 28 | return data; |
... | @@ -107,11 +107,11 @@ function handleMessage(message, current_channel){ | ... | @@ -107,11 +107,11 @@ function handleMessage(message, current_channel){ |
107 | else if(message.includes(' funny story')){ | 107 | else if(message.includes(' funny story')){ |
108 | Funnystory(current_channel); | 108 | Funnystory(current_channel); |
109 | } | 109 | } |
110 | - else if(message.includes(' userjoke')){ | 110 | + else if(message.includes(' my joke') || message.includes(' myjoke')){ |
111 | UserMakeJoke(message,current_channel); | 111 | UserMakeJoke(message,current_channel); |
112 | } | 112 | } |
113 | else if(message.includes(' me')){ | 113 | else if(message.includes(' me')){ |
114 | - 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]"; | 114 | + 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]"; |
115 | bot.postMessageToChannel(current_channel, "Tell you what??? :no_mouth:", emoji.emojis('no_mouth')); | 115 | bot.postMessageToChannel(current_channel, "Tell you what??? :no_mouth:", emoji.emojis('no_mouth')); |
116 | bot.postMessageToChannel(current_channel, comment, emoji.emojis('flushed')); | 116 | bot.postMessageToChannel(current_channel, comment, emoji.emojis('flushed')); |
117 | } | 117 | } |
... | @@ -175,7 +175,7 @@ function MakeJoke(message,user_channel){ | ... | @@ -175,7 +175,7 @@ function MakeJoke(message,user_channel){ |
175 | }); | 175 | }); |
176 | } | 176 | } |
177 | }); | 177 | }); |
178 | - comment="Sucess making joke!!:+1::thumbsup:\nWhen you want to show your joke, please enter @jokebot tell-me-userjoke"; | 178 | + comment="Sucess making joke!!:+1::thumbsup:\nWhen you want to show your joke, please enter @jokebot tell-me-my-joke"; |
179 | bot.postMessageToChannel(user_channel,`${comment}:kissing_heart:`,emoji.emojis('nerd_face')); | 179 | bot.postMessageToChannel(user_channel,`${comment}:kissing_heart:`,emoji.emojis('nerd_face')); |
180 | } | 180 | } |
181 | else{ | 181 | else{ |
... | @@ -427,8 +427,9 @@ knockknockJoke= (user_channel)=>{ | ... | @@ -427,8 +427,9 @@ knockknockJoke= (user_channel)=>{ |
427 | //Function for giving out information to user to control the bot | 427 | //Function for giving out information to user to control the bot |
428 | runHelp = (user_channel) =>{ | 428 | runHelp = (user_channel) =>{ |
429 | 429 | ||
430 | - 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" | 430 | + 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" |
431 | - current_jokes = "Joke types I have: 1)general , 2)knock-knock , 3)programming , 4)reddit, 5)funny story, 6)make joke 7)userjoke" | 431 | + current_jokes = "Joke types I have: 1)general , 2)knock-knock , 3)programming , 4)reddit, 5)funny story:laughing:\n"; |
432 | - bot.postMessageToChannel(user_channel, comment + current_jokes ,emoji.emojis('question')); | 432 | + 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:'"; |
433 | + bot.postMessageToChannel(user_channel, comment + current_jokes + ownJoke ,emoji.emojis('question')); | ||
433 | } | 434 | } |
434 | } | 435 | } | ... | ... |
-
Please register or login to post a comment