From 53797adb0b4d2848aeb961cc630549418da3f820 Mon Sep 17 00:00:00 2001 From: "Sean Fradl (Fraz)" Date: Tue, 22 Oct 2019 18:47:21 +0100 Subject: [PATCH 1/5] Update room.js Updated room.js to account for possible future depreciation of the current source of the timetable. Now uses a ***fancy*** open timetable script :) --- commands/room.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/room.js b/commands/room.js index 7dc09d0..f246c0d 100644 --- a/commands/room.js +++ b/commands/room.js @@ -4,12 +4,12 @@ var helpers = require("../helpers/helpers.js"); module.exports = { roomCommand: function(bot, args, receivedMessage) { if (args.length == 0) { - helpers.argumentsUsedExample(bot, receivedMessage, "room", "!room GLA.LG26"); + helpers.argumentsUsedExample(bot, receivedMessage, "room", "!room LG26"); return; } else if (args.length > 0) { request.post({ - url: "https://faas.jamesmcdermott.ie/function/dcurooms", + url: "https://brickbot.seanfradl.com/timetable", body: args }, function(error, response, body) { From e6a789b045e29161dde9d32ea891d6931256afa5 Mon Sep 17 00:00:00 2001 From: "Sean Fradl (Fraz)" Date: Tue, 22 Oct 2019 18:47:39 +0100 Subject: [PATCH 2/5] Update room.js --- commands/room.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/room.js b/commands/room.js index f246c0d..bfdb481 100644 --- a/commands/room.js +++ b/commands/room.js @@ -9,7 +9,7 @@ module.exports = { } else if (args.length > 0) { request.post({ - url: "https://brickbot.seanfradl.com/timetable", + url: "https://brickbot.seanfradl.com/timetable/", body: args }, function(error, response, body) { From 20ec94c7b9c598d2d9fb61418549f46212436c79 Mon Sep 17 00:00:00 2001 From: "Sean Fradl (Fraz)" Date: Tue, 22 Oct 2019 18:49:06 +0100 Subject: [PATCH 3/5] Added cmtCommand Gets the current cmt based on the cmt on the google sheet that feeds the website. --- commands/cmt.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 commands/cmt.js diff --git a/commands/cmt.js b/commands/cmt.js new file mode 100644 index 0000000..6656f3d --- /dev/null +++ b/commands/cmt.js @@ -0,0 +1,14 @@ +var request = require("request"); +var helpers = require("../helpers/helpers.js"); + +module.exports = { + cmtCommand: function(bot, args, receivedMessage) { + request.post({ + url: "https://brickbot.seanfradl.com/cmt", + body: args + }, + function(error, response, body) { + receivedMessage.channel.send(helpers.embedify(bot, body)); + }); + } +}; From 1251dfd3903893aa10da1b3b06db6efa502eac3c Mon Sep 17 00:00:00 2001 From: "Sean Fradl (Fraz)" Date: Tue, 22 Oct 2019 18:50:01 +0100 Subject: [PATCH 4/5] Added eventsCommand Get's the 4 latest events that are upcoming based on the google sheet that serves the website. --- commands/events.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 commands/events.js diff --git a/commands/events.js b/commands/events.js new file mode 100644 index 0000000..b657dd7 --- /dev/null +++ b/commands/events.js @@ -0,0 +1,14 @@ +var request = require("request"); +var helpers = require("../helpers/helpers.js"); + +module.exports = { + eventsCommand: function(bot, args, receivedMessage) { + request.post({ + url: "https://brickbot.seanfradl.com/events", + body: args + }, + function(error, response, body) { + receivedMessage.channel.send(helpers.embedify(bot, body)); + }); + } +}; From ff7894177f2e6cba6e87deeba8317ce2572a5ab7 Mon Sep 17 00:00:00 2001 From: "Sean Fradl (Fraz)" Date: Tue, 22 Oct 2019 18:51:45 +0100 Subject: [PATCH 5/5] Updated commands to include cmt and events command. --- bot.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bot.js b/bot.js index 695f5cb..98eacbe 100644 --- a/bot.js +++ b/bot.js @@ -79,6 +79,13 @@ function processCommand(receivedMessage) { case "wiki": commands.wiki.wikiCommand(bot, args, receivedMessage); break; + case "cmt": + commands.cmt.cmtCommand(bot, args, receivedMessage); + break; + case "events": + commands.events.eventsCommand(bot, args, receivedMessage); + break; + default: receivedMessage.channel.send(helpers.embedify(bot, "I don't understand the command. Try `!help [command]`")); }