-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ccda62
commit 667ece4
Showing
13 changed files
with
4,400 additions
and
1,234 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules | ||
build | ||
dist | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-typescript"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
declare module 'steam-user'; | ||
declare module 'steamcommunity'; | ||
declare module 'steam-tradeoffer-manager'; |
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import config from '../../config.json'; | ||
import SteamUser from 'steam-user'; | ||
import SteamCommunity from 'steamcommunity'; | ||
import SteamTotp from 'steam-totp'; | ||
import TradeOfferManager from 'steam-tradeoffer-manager'; | ||
import { info, Ad } from './logger'; | ||
|
||
Ad.startup(); | ||
|
||
const client = new SteamUser(); | ||
const community = new SteamCommunity(); | ||
|
||
const manager = new TradeOfferManager({ | ||
steam: client, | ||
community, | ||
language: 'en' | ||
}); | ||
|
||
info('TradeOfferManager is ready'); | ||
|
||
const { username, sharedSecret, password } = config.steam; | ||
const { gameId } = config.info; | ||
|
||
client.logOn({ | ||
accountName: username, | ||
password: password, | ||
twoFactorCode: SteamTotp.generateAuthCode(sharedSecret) | ||
}); | ||
|
||
client.on('loggedOn', () => { | ||
info(`Logged into steam with username ${username}`); | ||
client.setPersona(1); | ||
client.gamesPlayed(gameId); | ||
}); | ||
|
||
info('App initialized'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { enable } from 'colors'; | ||
|
||
enable(); | ||
|
||
function printAll(prefix: string, color: string | undefined, ...message: string[]) { | ||
message.forEach((msg) => console.log(`[${prefix}]`.blue, color ? msg[color] : msg)); | ||
} | ||
|
||
export function info(...message: string[]) { | ||
printAll('INFO', 'green', ...message); | ||
} | ||
|
||
export function warn(...message: string[]) { | ||
printAll('WARN', 'yellow', ...message); | ||
} | ||
|
||
export function error(...message: string[]) { | ||
printAll('ERROR', 'red', ...message); | ||
} | ||
|
||
export function log(...message: string[]) { | ||
printAll('#', undefined, ...message); | ||
} | ||
|
||
export namespace Ad { | ||
export function startup() { | ||
log( | ||
'This bot was developed by Arthur Fiorette'.white, | ||
'Visit us on GitHub!'.white, | ||
'https://github.com/ArthurFiorette/steam-trader'.white, | ||
'', | ||
'Loading...'.green | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"help": "Need help? https://github.com/ArthurFiorette/steam-trader", | ||
"steam": { | ||
"username": "username", | ||
"password": "password", | ||
"sharedSecret": "shared secret", | ||
"identitySecret": "identity secret" | ||
}, | ||
"info": { | ||
"gameId": 730 | ||
}, | ||
"trading": { | ||
"trashValue": 0.04, | ||
"ownerId": 76561198850668121 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: '3' | ||
services: | ||
app: | ||
build: src/ | ||
ports: '1227:1227' | ||
build: app/ | ||
ports: '${PORT}:1227' | ||
env_file: | ||
- '.env' | ||
- './app/.env' |
Oops, something went wrong.