From 2a5bcb03f0c4bc1f6b0ec28cdf33b128dda35068 Mon Sep 17 00:00:00 2001 From: nicnacnic Date: Mon, 24 May 2021 20:22:56 -0400 Subject: [PATCH] Delete extension directory --- extension/index.js | 60 --------------------------- extension/utils/nodecg-api-context.js | 12 ------ 2 files changed, 72 deletions(-) delete mode 100644 extension/index.js delete mode 100644 extension/utils/nodecg-api-context.js diff --git a/extension/index.js b/extension/index.js deleted file mode 100644 index c7abec2..0000000 --- a/extension/index.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fetch = require("node-fetch"); -let oengusURL; -let oengusSandbox = false; - -module.exports = function(nodecg) { - setTimeout(() => { nodecg.log.info("All layouts loaded successfully.") }, 200); - if (nodecg.bundleConfig.donation.useTiltify) { - fetch(`https://tiltify.com/api/v3/campaigns/${nodecg.bundleConfig.donation.tiltifyCampaignID}`, { - method: 'GET', - headers: { - 'Authorization': `Bearer ${nodecg.bundleConfig.donation.tiltifyAuthToken}` - }, - dataType: 'json', - }).then(function(response) { - if (response.status === 403) { - nodecg.log.warn("Your Tiltify campaign ID or auth token is incorrect. (403 - Forbidden)") - nodecg.log.warn("Tiltify features disabled.") - } - else if (response.status === 500) { - nodecg.log.warn("There was error accessing Tiltify's servers. (500 - Internal Server Error)") - nodecg.log.warn("Tiltify features disabled.") - } - else { - nodecg.log.info(`Connected to campaign ID ${nodecg.bundleConfig.donation.tiltifyCampaignID}! Tiltify features enabled.`) - } - }); - } - else if (nodecg.bundleConfig.donation.useOengus) { - if (nodecg.bundleConfig.donation.oengusUseSandbox) { - oengusURL = `https://sandbox.oengus.io/api/marathon/${nodecg.bundleConfig.donation.oengusMarathon}`; - oengusSandbox = true; - } - else - oengusURL = `https://oengus.io/api/marathon/${nodecg.bundleConfig.donation.oengusMarathon}`; - fetch(oengusURL, { - method: 'GET', - dataType: 'json', - }).then(function(response) { - if (response.status === 404) { - nodecg.log.warn("Your Oengus short name is incorrect. (404 - Not Found)") - nodecg.log.warn("Oengus features disabled.") - } - else if (response.status === 500) { - nodecg.log.warn("There was error accessing Oengus' servers. (500 - Internal Server Error)") - nodecg.log.warn("Oengus features disabled.") - } - else { - nodecg.log.info(`Connected to marathon ${nodecg.bundleConfig.donation.oengusMarathon}! Oengus features enabled.`) - if (oengusSandbox) - nodecg.log.warn("You are using a Oengus sandbox marathon! To disable, set oengusUseSandbox to false."); - - } - }); - } - else { - nodecg.log.warn("Tiltify and Oengus features are disabled.") - } -} diff --git a/extension/utils/nodecg-api-context.js b/extension/utils/nodecg-api-context.js deleted file mode 100644 index 94f0ce4..0000000 --- a/extension/utils/nodecg-api-context.js +++ /dev/null @@ -1,12 +0,0 @@ -// https://github.com/GamesDoneQuick/agdq18-layouts/blob/master/extension/util/nodecg-api-context.js - -'use strict'; -let context; -module.exports = { - get() { - return context; - }, - set(ctx) { - context = ctx; - } -}; \ No newline at end of file