This commit is contained in:
Daniel Løvbrøtte Olsen 2016-08-21 18:27:11 +02:00 committed by GitHub
parent bc45256b7f
commit 7db432a293
2 changed files with 9 additions and 1 deletions

View File

@ -36,6 +36,7 @@ bot.dialog('/', new builder.IntentDialog()
.matches(helper.regex("about"), function(s) {cmd.about(s)})
.matches(helper.regex("help"), function(s) {cmd.help(s)})
.matches(helper.regex("meme \\w+"), function(s) {cmd.meme(s)})
.matches(helper.regex("memes"), function(s) {cmd.memes(s)})
.onDefault(function(session) {
session.send("I didn't understand. Say 'help' to get a list of commands!");
}));

View File

@ -43,7 +43,9 @@ text.help = [
"about - Gives you information about the bot",
"ping - pong!",
"stuff - Information about different services we use",
"games - IPs and other related information about game servers we use"
"games - IPs and other related information about game servers we use",
"meme - meme <meme.png> posts the relevant meme",
"memes - lists all available memes"
];
exports.help = function(session) {
@ -71,3 +73,8 @@ exports.meme = function(session) {
}
}
exports.memes = function(session) {
var memes = fs.readdirSync("/usr/src/app/memes/");
helper.send(session, ["My available memes are:", memes.join(", ")]);
}