SHOW:
|
|
- or go back to the newest paste.
1 | const SteamUser = require('steam-user'); | |
2 | const SteamTotp = require('steam-totp'); | |
3 | const config = require('./config.json'); | |
4 | const client = new SteamUser(); | |
5 | ||
6 | ||
7 | const logOnOptions = { | |
8 | accountName: config.username, | |
9 | password: config.password, | |
10 | twoFactorCode: SteamTotp.generateAuthCode(config.sharedSecret) | |
11 | }; | |
12 | ||
13 | client.logOn(logOnOptions); | |
14 | ||
15 | client.on('loggedOn', () => { | |
16 | console.log('succesfully logged on.'); | |
17 | client.setPersona(SteamUser.Steam.EPersonaState.Online); | |
18 | client.gamesPlayed(["Custom Game",440]); | |
19 | }); | |
20 | ||
21 | client.on("friendMessage", function(steamID, message) { | |
22 | - | if (message == "!help") { |
22 | + | if(message.indexOf("!help") > -1) { |
23 | - | client.chatMessage(steamID, "This is an automated message!"); |
23 | + | client.chatMessage(steamID, "This is a help text :3"); |
24 | } | |
25 | }); |