summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-06-21 22:32:13 +0200
committerRaindropsSys <contact@minteck.org>2023-06-21 22:32:13 +0200
commit98363de507a6b0b04956db4d31c41eddae6b6a63 (patch)
treeb18d17b0a739dda16ec9d376f60403b475593ce4
parent7b4d26866bfc9d3c24e61945adc37416685dd463 (diff)
downloadbutterscotch-98363de507a6b0b04956db4d31c41eddae6b6a63.tar.gz
butterscotch-98363de507a6b0b04956db4d31c41eddae6b6a63.tar.bz2
butterscotch-98363de507a6b0b04956db4d31c41eddae6b6a63.zip
Added 2 files and deleted 2 files (automated)
-rw-r--r--commands/evening.js53
-rw-r--r--commands/front.js25
-rw-r--r--help/evening.json6
-rw-r--r--help/front.json6
4 files changed, 59 insertions, 31 deletions
diff --git a/commands/evening.js b/commands/evening.js
new file mode 100644
index 0000000..3503771
--- /dev/null
+++ b/commands/evening.js
@@ -0,0 +1,53 @@
+const axios = require("axios");
+
+module.exports = (parameter, wrapper) => {
+ if (wrapper.sender !== "@cloudburst:equestria.dev" && wrapper.sender !== "@raindrops:equestria.dev" && wrapper.sender !== "186730180872634368" && wrapper.sender !== "493845599469174794") {
+ wrapper.send("⛔️ This command is private and you are not allowed to use it.");
+ return;
+ }
+
+ /*
+
+ [ - Will be 'null' if the day has been ignored
+ [
+ string[] - Full names of the members of Cloudburst fronting today
+ string[] - Full names of the members of Raindrops fronting today
+ ],
+ [
+ string[] - Full names of the members of Cloudburst fronting tomorrow
+ string[] - Full names of the members of Raindrops fronting tomorrow
+ ]
+ ]
+
+ */
+
+ axios.get("https://ponies.equestria.horse/api/evening", {
+ headers: {
+ 'Cookie': 'PEH2_SESSION_TOKEN=' + require('../credentials.json').coldhaze
+ }
+ }).then(res => {
+ let data = res.data;
+
+ let text = "🌙 Here is what is scheduled for the next nights:\n\n### Tonight\n";
+
+ if (data[0]) {
+ text += "* **" + data[0][0].join("** and **") + "**\n";
+ text += "* **" + data[0][1].join("** and **") + "**";
+ } else {
+ text += "*Tonight has been marked as ignored*";
+ }
+
+ text += "\n\n### Tomorrow\n";
+
+ if (data[1]) {
+ text += "* **" + data[1][0].join("** and **") + "**\n";
+ text += "* **" + data[1][1].join("** and **") + "**";
+ } else {
+ text += "*Tomorrow has been marked as ignored*";
+ }
+
+ text += "\n\n[[View on Cold Haze](https://ponies.equestria.horse/-/evening)]";
+
+ wrapper.send(text);
+ });
+} \ No newline at end of file
diff --git a/commands/front.js b/commands/front.js
deleted file mode 100644
index 44a187b..0000000
--- a/commands/front.js
+++ /dev/null
@@ -1,25 +0,0 @@
-const axios = require("axios");
-
-module.exports = (parameter, wrapper) => {
- if (wrapper.sender !== "@cloudburst:equestria.dev" && wrapper.sender !== "@raindrops:equestria.dev" && wrapper.sender !== "186730180872634368" && wrapper.sender !== "493845599469174794") {
- wrapper.send("⛔️ This command is private and you are not allowed to use it.");
- return;
- }
-
- if (new Date().getTime() / 1000 >= 1686787200) {
- wrapper.send("⚠️ This command is outdated and has been disabled. Please use the [evening schedule on Cold Haze](https://ponies.equestria.horse/-/evening) until a replacement is made.");
- return;
- }
-
- axios.get("https://ponies.equestria.horse/api/schedule", {
- headers: {
- 'Cookie': 'PEH2_SESSION_TOKEN=' + require('../credentials.json').coldhaze
- }
- }).then((res) => {
- if (new Date().toDateString() === "Wed Jun 14 2023") {
- wrapper.send("📆 Here is what is planned:\n\n" + res.data['today'].map(i => "* **" + i['cloudburst'].join(" and ") + "** with **" + i['raindrops'].join(" and ") + "**").join("\n") + "\n\n[[View on Cold Haze](https://ponies.equestria.horse/-/fronting)]");
- } else {
- wrapper.send("📆 Here is what is planned:\n\n### Today\n" + res.data['today'].map(i => "* **" + i['cloudburst'].join(" and ") + "** with **" + i['raindrops'].join(" and ") + "**").join("\n") + "\n\n### Tomorrow\n" + res.data['tomorrow'].map(i => "* **" + i['cloudburst'].join(" and ") + "** with **" + i['raindrops'].join(" and ") + "**").join("\n") + "\n\n[[View on Cold Haze](https://ponies.equestria.horse/-/fronting)]");
- }
- });
-} \ No newline at end of file
diff --git a/help/evening.json b/help/evening.json
new file mode 100644
index 0000000..2604516
--- /dev/null
+++ b/help/evening.json
@@ -0,0 +1,6 @@
+{
+ "description": "Shows a summary of the evening schedule.",
+ "parameters": "",
+ "aliases": [ "schedule", "planner", "f", "plan", "e", "evening" ],
+ "exempt": false
+} \ No newline at end of file
diff --git a/help/front.json b/help/front.json
deleted file mode 100644
index a78d600..0000000
--- a/help/front.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "description": "Shows a summary of the fronting schedule.",
- "parameters": "",
- "aliases": [ "schedule", "planner", "f", "plan" ],
- "exempt": false
-} \ No newline at end of file