Skip to content
This repository has been archived by the owner on Aug 20, 2019. It is now read-only.

Commit

Permalink
🚀 Initial Application 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
supergrecko committed Jun 26, 2019
1 parent eb8d0ca commit 8453661
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 0 deletions.
55 changes: 55 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "lolswap",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/supergrecko/lolswap.git"
},
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/supergrecko/lolswap/issues"
},
"homepage": "https://github.com/supergrecko/lolswap#readme",
"dependencies": {
"league-connect": "^1.0.3"
}
}
21 changes: 21 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Connector from 'league-connect';

let id: string = process.argv[2];

const icon: number = parseFloat(id);

Connector.connect().then((res) => {
Connector.sendRequest({
url: 'lol-summoner/v1/current-summoner/icon',
method: 'PUT',
body: {
profileIconId: icon
}
}).then((res) => {
console.log('Summoner Icon has been changed.');
}).catch(() => {
console.log('Invalid Summoner Icon ID. If this problem persists, restart your League Client and retry.')
})
}).catch((err) => {
console.error(err);
});
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"strict": true,
"esModuleInterop": true,
"outDir": "./dist"
}
}

0 comments on commit 8453661

Please sign in to comment.