mirror of
https://github.com/xHyroM/roles-bot.git
synced 2024-11-24 17:21:05 +01:00
actions - not finished
This commit is contained in:
parent
4a282fd156
commit
c4754a7a65
6 changed files with 115 additions and 0 deletions
32
.github/actions/avatar-changer/index.js
vendored
Normal file
32
.github/actions/avatar-changer/index.js
vendored
Normal file
|
@ -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)
|
||||
})();
|
6
.github/actions/avatar-changer/list.txt
vendored
Normal file
6
.github/actions/avatar-changer/list.txt
vendored
Normal file
|
@ -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
|
1
.github/actions/avatar-changer/now.txt
vendored
Normal file
1
.github/actions/avatar-changer/now.txt
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
0
|
BIN
.github/actions/avatar-changer/out.png
vendored
Normal file
BIN
.github/actions/avatar-changer/out.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 966 B |
61
.github/actions/avatar-changer/package-lock.json
generated
vendored
Normal file
61
.github/actions/avatar-changer/package-lock.json
generated
vendored
Normal file
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
15
.github/actions/avatar-changer/package.json
vendored
Normal file
15
.github/actions/avatar-changer/package.json
vendored
Normal file
|
@ -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"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue