From c4754a7a65942172bb411097b54f0014a6cdb375 Mon Sep 17 00:00:00 2001 From: xhyrom Date: Sun, 2 Jan 2022 18:47:23 +0100 Subject: [PATCH] actions - not finished --- .github/actions/avatar-changer/index.js | 32 +++++++++ .github/actions/avatar-changer/list.txt | 6 ++ .github/actions/avatar-changer/now.txt | 1 + .github/actions/avatar-changer/out.png | Bin 0 -> 966 bytes .../actions/avatar-changer/package-lock.json | 61 ++++++++++++++++++ .github/actions/avatar-changer/package.json | 15 +++++ 6 files changed, 115 insertions(+) create mode 100644 .github/actions/avatar-changer/index.js create mode 100644 .github/actions/avatar-changer/list.txt create mode 100644 .github/actions/avatar-changer/now.txt create mode 100644 .github/actions/avatar-changer/out.png create mode 100644 .github/actions/avatar-changer/package-lock.json create mode 100644 .github/actions/avatar-changer/package.json diff --git a/.github/actions/avatar-changer/index.js b/.github/actions/avatar-changer/index.js new file mode 100644 index 0000000..9729b05 --- /dev/null +++ b/.github/actions/avatar-changer/index.js @@ -0,0 +1,32 @@ +const fs = require('fs'); +const hyttpo = require('hyttpo').default; + +const list = fs.readFileSync('./list.txt', 'utf-8').split('\n'); +let now = Number(fs.readFileSync('./now.txt', 'utf-8')); + +(async() => { + if (now === list.length) now = 0; + + const url = list[now + 1]; + + const req = await hyttpo.request({ + method: 'GET', + responseType: 'buffer', + url + }).catch(e => e) + + const base64 = `data:image/png;base64,${req.data.toString('base64')}`; + + const bot = await hyttpo.request({ + url: 'https://discord.com/api/v9/applications/745599648110215260', + method: 'PATCH', + headers: { + 'Authorization': 'Bot' + }, + body: JSON.stringify({ + icon: base64 + }) + }).catch(e => e) + + console.log(bot) +})(); \ No newline at end of file diff --git a/.github/actions/avatar-changer/list.txt b/.github/actions/avatar-changer/list.txt new file mode 100644 index 0000000..7cb167c --- /dev/null +++ b/.github/actions/avatar-changer/list.txt @@ -0,0 +1,6 @@ +https://izboxo.cz/sources/images/Bucket_of_Cod_JE2_BE2.png +https://izboxo.cz/sources/images/Bucket_of_Axolotl_JE1_BE1.png +https://izboxo.cz/sources/images/Bucket_of_Pufferfish_JE2_BE2.png +https://izboxo.cz/sources/images/Bucket_of_Salmon_JE2_BE2.png +https://izboxo.cz/sources/images/Bucket_of_Tadpole_BE1.png +https://izboxo.cz/sources/images/Bucket_of_Tropical_Fish_JE3_BE2.png \ No newline at end of file diff --git a/.github/actions/avatar-changer/now.txt b/.github/actions/avatar-changer/now.txt new file mode 100644 index 0000000..c227083 --- /dev/null +++ b/.github/actions/avatar-changer/now.txt @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/.github/actions/avatar-changer/out.png b/.github/actions/avatar-changer/out.png new file mode 100644 index 0000000000000000000000000000000000000000..ed81d9c236541f5cec40352dfcaa37cc2fd3268d GIT binary patch literal 966 zcmeAS@N?(olHy`uVBq!ia0vp^3qY8I8A$FCoGuTfSkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP{Jm_C&U#<-;JO2K7Zn6 z-}ax!p8UE0!IB}{#Kc6|@6@xNOU7~6*N4rydiCnEWy_rNo)s1rPMI?0ylL^DKY#xJ z|L=Ik?I=(`V@Z%-FoVOh8)+a;lDE5yFwgFoX+REpiKnkC`%_LPad~66 z$B>F!Z*QCqI^-bG7I=iaEAYzq`iSzs`OB6ysXROMbDHzA;)v3N4-Gc8XT9nDxr~8H z&z4o7;HBnkcDdEpZYG!OE(&_tf+ze>QUff&+gU&xfA7x4L+{ zK+)qXyaGT_P=8?IuN9lteTp%dA8L2D*ZXTI*!X+wA9kOL&#>gSU%jrL8Km;Vy#~cC z5o1QJR}% zW#y8eT$-DjS7K!q090DcV7UDMZhbU0o*+}KtUOXP(=$pK49yHQPxEX8su4#r2dXAK zGo>U0q-2*>%xj<$NhBq{nYpPYl?AB`U{~oE<{9 literal 0 HcmV?d00001 diff --git a/.github/actions/avatar-changer/package-lock.json b/.github/actions/avatar-changer/package-lock.json new file mode 100644 index 0000000..5571dde --- /dev/null +++ b/.github/actions/avatar-changer/package-lock.json @@ -0,0 +1,61 @@ +{ + "name": "avatar-changer", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "avatar-changer", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "hyttpo": "^0.3.2" + } + }, + "node_modules/follow-redirects": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", + "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/hyttpo": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/hyttpo/-/hyttpo-0.3.2.tgz", + "integrity": "sha512-Y1QJlBXOZtHKhME6AEBdxPrzJrV5xcORZm/+rbHwXGlau2n2OBNAbsiIJ3eiT1ZizJClm+RmwjytDSySOXJcOg==", + "dependencies": { + "follow-redirects": "^1.14.6" + }, + "engines": { + "node": ">=16.x" + } + } + }, + "dependencies": { + "follow-redirects": { + "version": "1.14.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.6.tgz", + "integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==" + }, + "hyttpo": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/hyttpo/-/hyttpo-0.3.2.tgz", + "integrity": "sha512-Y1QJlBXOZtHKhME6AEBdxPrzJrV5xcORZm/+rbHwXGlau2n2OBNAbsiIJ3eiT1ZizJClm+RmwjytDSySOXJcOg==", + "requires": { + "follow-redirects": "^1.14.6" + } + } + } +} diff --git a/.github/actions/avatar-changer/package.json b/.github/actions/avatar-changer/package.json new file mode 100644 index 0000000..983519f --- /dev/null +++ b/.github/actions/avatar-changer/package.json @@ -0,0 +1,15 @@ +{ + "name": "avatar-changer", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "hyttpo": "^0.3.2" + } +}