diff options
-rw-r--r-- | assets/changelog.txt | 13 | ||||
-rw-r--r-- | assets/public/user.css | 18 | ||||
-rw-r--r-- | package.json | 3 | ||||
-rw-r--r-- | scripts/changelog.js | 28 |
4 files changed, 61 insertions, 1 deletions
diff --git a/assets/changelog.txt b/assets/changelog.txt new file mode 100644 index 00000000..c1abc125 --- /dev/null +++ b/assets/changelog.txt @@ -0,0 +1,13 @@ +---changelog--- +date: "2022-10-27" +locale: "en-US" +revision: 1 +--- +Changelogs now work! {added marginTop} +====================== + +In the future, they'll be sent out like this, as well as in the default guild. +If you aren't in the default guild, you're missing out. +We talk mostly about Slowcord itself, and its the first place you'll find out about new features and bug fixes being worked on. +Be sure to join it, with +https://slowcord.understars.dev/invite/slowcord \ No newline at end of file diff --git a/assets/public/user.css b/assets/public/user.css index e69de29b..a42a3e3a 100644 --- a/assets/public/user.css +++ b/assets/public/user.css @@ -0,0 +1,18 @@ +/* hide premium references */ +a[href="/store"], +div[aria-controls="slowcord-premium-tab"], +div[aria-controls="premium-guild-boost-tab"], +div[aria-controls="subscriptions-tab"], +div[aria-controls="library-inventory-tab"], +div[aria-controls="billing-tab"], +div[aria-label="User Settings"] div.header-2Kx1US:nth-child(8), /* billing settings header */ +div[aria-label="User Settings"] div.separator-2wx7h6:nth-child(7), /* billing settings separator */ +button[aria-label="Send a gift"], +div#guild-header-popout-premium-subscribe, +#guild-header-popout div.separator-1So4YB:nth-child(2), +div[aria-controls="guild_premium-tab"], +div#stickers-tab .upsellContainer-22N_CL, +div#stickers-tab .divider-wz_a_k, +div.separator-2wx7h6:nth-child(20) { + display: none !important; +} \ No newline at end of file diff --git a/package.json b/package.json index 47424da3..ef2cc223 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "setup": "npm run build && npm run generate:schema", "generate:rights": "node scripts/rights.js", "generate:schema": "node scripts/schema.js", - "generate:client": "node scripts/client.js" + "generate:client": "node scripts/client.js", + "generate:changelog": "node scripts/changelog.js" }, "main": "dist/bundle/index.js", "types": "src/bundle/index.ts", diff --git a/scripts/changelog.js b/scripts/changelog.js new file mode 100644 index 00000000..412e6e0c --- /dev/null +++ b/scripts/changelog.js @@ -0,0 +1,28 @@ +const fetch = require("node-fetch"); +const fs = require("fs/promises"); +const path = require("path"); + +const CACHE_PATH = path.join(__dirname, "..", "assets", "cache"); +const CHANGELOG_PATH = path.join(__dirname, "..", "assets", "changelog.txt"); +const BASE_URL = "https://discord.com"; + +const CHANGELOG_SCRIPT = "9c4b2d313c6e1c864e89.js"; + +(async () => { + const res = await fetch(`${BASE_URL}/assets/${CHANGELOG_SCRIPT}`); + const text = await res.text(); + + const newChangelogText = (await fs.readFile(CHANGELOG_PATH)) + .toString() + .replaceAll("\r", "") + .replaceAll("\n", "\\n") + .replaceAll("\'", "\\'"); + + const index = text.indexOf("e.exports='---changelog---") + 11; + const endIndex = text.indexOf("'\n", index); // hmm + + await fs.writeFile( + path.join(CACHE_PATH, CHANGELOG_SCRIPT), + text.substring(0, index) + newChangelogText + text.substring(endIndex) + ); +})(); \ No newline at end of file |