-
Notifications
You must be signed in to change notification settings - Fork 0
/
Steam.js
37 lines (32 loc) · 989 Bytes
/
Steam.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const Steam = {
accounts: {},
getAuthCode: (shared_secret) => require("steam-totp").getAuthCode(shared_secret),
accountPicker: () => {
const inline_keyboard = [];
Object.keys(Steam.accounts).forEach(name => {
const account = Steam.accounts[name];
inline_keyboard.push([{
text: account.account_name,
callback_data: account.account_name
}])
});
return {
reply_markup: JSON.stringify({
inline_keyboard: inline_keyboard
})
};
}
};
try {
const fs = require("fs");
fs.readdirSync("accounts")
.filter(filename => filename.startsWith("Steamguard-"))
.forEach(file => {
const data = JSON.parse(fs.readFileSync(`accounts/${file}`, "utf8"));
Steam.accounts[data.account_name] = data;
});
} catch (err) {
console.error(err);
process.exit(1);
}
module.exports = Steam;