├── images
├── pfp.jpg
└── ss.png
├── src
├── config.json
└── comments.json
├── package.json
├── LICENSE
├── README.md
└── app.js
/images/pfp.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaAboutalebi/Steam-Comment-Bot/HEAD/images/pfp.jpg
--------------------------------------------------------------------------------
/images/ss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SinaAboutalebi/Steam-Comment-Bot/HEAD/images/ss.png
--------------------------------------------------------------------------------
/src/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "username":"",
3 | "password":"",
4 | "admin":"",
5 | "identitySecret":""
6 | }
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "steamcommentbot",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "nodemon app.js"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "axios": "^0.27.2",
13 | "moment": "^2.29.3",
14 | "steam-totp": "^2.1.2",
15 | "steam-tradeoffer-manager": "^2.10.5",
16 | "steam-user": "^4.24.3",
17 | "steamcommunity": "^3.44.1"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Zer0Power
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/comments.json:
--------------------------------------------------------------------------------
1 | {
2 | "heart":["❤️","🧡", "💛", "💚", "💙", "💜", "🖤", "🤎", "🤍", "❣️", "💕", "💞", "💓", "💗", "💖", "💘", "💝"],
3 | "bigheart":["\n────(♥)(♥)(♥)────(♥)(♥)(♥)\n──(♥)██████(♥)(♥)██████(♥)\n─(♥)████████(♥)████████(♥)\n─(♥)██████████████████(♥)\n──(♥)████████████████(♥)\n────(♥)████████████(♥)\n──────(♥)████████(♥)\n────────(♥)████(♥)\n─────────(♥)██(♥)\n───────────(♥)","\n─▄████▄████▄\n██▒▒▒▒█▒▒▒▒██(¯`•´¯)\n▀██▒▒▒▒▒▒▒██▀.*•❀•*.\n─▀██▒▒▒▒▒██▀.•..(¯`•´¯)\n───▀██▒██▀(¯`•´¯)*•❀•*\n─────▀█▀…•..*•❀•*"],
4 | "niceday":["Have a nice day","нανє α иι¢є ∂αу❤️🔥", "。 ゚ . .\n, . . .\n 。 ゚ 。\n . . . 。 . \n . 𝓗𝓪𝓿𝓮 𝓪 𝓰𝓻𝓮𝓪𝓽 𝔀𝓮𝓮𝓴ㅤㅤ ㅤㅤㅤㅤㅤ 。 .\n 。 ゚ . .\n, . . .\n 。 ゚ 。\n . . . 。 . "],
5 | "rep":["+Rep","+Rep Friendly 🤍","+Rep Kind Person 🖤","+rep Good player 💙","+rep Amazing profile ❤️"],
6 | "all":["𝓝𝓸 𝔀𝓲𝓼𝓱 𝓲𝓼 𝓼𝓸 𝓿𝓪𝓵𝓾𝓪𝓫𝓵𝓮 𝓪𝓼 𝓽𝓸 𝓳𝓾𝓼𝓽𝓲𝓯𝔂 𝓪 𝓫𝓻𝓸𝓴𝓮𝓷 𝓱𝓮𝓪𝓻𝓽 ❤️","𝘯𝘪𝘤𝘦 𝘱𝘳𝘰𝘧𝘪𝘭𝘦 🔥","╔╦╦\n╠╬╬╬╣\n╠╬╬╬╣ | ♥️\n╠╬╬╬╣ 𝓢𝓲𝓰𝓷𝓮𝓭 𝓑𝔂 -/𝘌𝘭𝘪 𝘵𝘩𝘦 𝘴𝘭𝘦𝘦𝘱 𝘥𝘦𝘢𝘭𝘦𝘳\n╚╩╩╩╝"]
7 | }
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
Steam Comment Bot
10 |
11 |
12 | Simple Steam Comment bot built with js
13 |
14 | Explore the docs »
15 |
16 |
17 | View Demo
18 | ·
19 | Report Bug
20 | ·
21 | Request Feature
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | Table of Contents
30 |
31 | -
32 | About The Project
33 |
34 | -
35 |
39 |
40 | - Roadmap
41 | - Contributing
42 | - License
43 | - Contact
44 |
45 |
46 |
47 |
48 |
49 |
50 | ## About The Project
51 |
52 |
53 |
54 |
55 | ### Prerequisites
56 |
57 | This is an example of how to list things you need to use the software and how to install them.
58 | * npm
59 | ```sh
60 | npm install npm@latest -g
61 | ```
62 |
63 | ### Installation
64 |
65 | 1. Clone the repo
66 | ```sh
67 | git clone https://github.com/Zer0Power/Steam-Comment-Bot
68 | ```
69 | 2. Install NPM packages
70 | ```sh
71 | npm install
72 | ```
73 | 3. Edit Config File
74 | ```json
75 | "username":"username",
76 | "password":"password",
77 | "admin":"adminID64",
78 | "identitySecret":"Search On Google"
79 | ```
80 | 4. Run the Project
81 | ```sh
82 | npm run test
83 | ```
84 |
85 |
86 | ## Roadmap
87 |
88 | See the [open issues](https://github.com/Zer0Power/Steam-Comment-Bot) for a list of proposed features (and known issues).
89 |
90 |
91 |
92 |
93 | ## Contributing
94 |
95 | Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.
96 |
97 | 1. Fork the Project
98 | 2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
99 | 3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
100 | 4. Push to the Branch (`git push origin feature/AmazingFeature`)
101 | 5. Open a Pull Request
102 |
103 |
104 |
105 |
106 | ## License
107 |
108 | Distributed under the MIT License. See `LICENSE` for more information.
109 |
110 |
111 |
112 |
113 | ## Contact
114 |
115 | Project Link: [https://github.com/Zer0Power/Steam-Comment-Bot](https://github.com/Zer0Power/Steam-Comment-Bot)
116 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
2 | //Import Packages
3 |
4 | const moment = require('moment');
5 | const util = require("util");
6 | const axios = require('axios');
7 | const SteamUser = require('steam-user');
8 | const SteamCommunity = require('steamcommunity');
9 | const TradeOfferManager = require('steam-tradeoffer-manager');
10 |
11 | const config = require('./src/config.json');
12 | const comments = require('./src/comments.json');
13 |
14 | const client = new SteamUser();
15 | const community = new SteamCommunity();
16 |
17 | const manager = new TradeOfferManager({
18 | steam: client,
19 | community: community,
20 | language: 'en'
21 | });
22 |
23 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
24 | //Functions
25 |
26 | function format(seconds){
27 | function pad(s){
28 | return (s < 10 ? '0' : '') + s;
29 | }
30 | var hours = Math.floor(seconds / (60*60));
31 | var minutes = Math.floor(seconds % (60*60) / 60);
32 | var seconds = Math.floor(seconds % 60);
33 | return pad(hours) + ':' + pad(minutes) + ':' + pad(seconds);
34 | }
35 |
36 | async function postComment(steamID ,comment){
37 |
38 | /* Api Get data */
39 | const GetData = async () => {
40 | const options = {
41 | method: 'GET',
42 | url: 'https://steamcommunity.com/groups/Jdm_loverss/memberslistxml/?xml=1'
43 | };
44 | const result = await axios.request(options)
45 | return result.data
46 | }
47 | /* ------------ */
48 | const data = await GetData()
49 | if (data.includes(steamID)){client.chatMessage(steamID, "OKi Doki,\n I'll comment your profile!😇")
50 | community.postUserComment(steamID, comment)
51 | console.log(comment)}else{
52 | client.chatMessage(steamID, "😪I can't find you in my group\nplz join my group then try again!😇\nhttps://steamcommunity.com/groups/Jdm_loverss")
53 | }
54 |
55 | }
56 |
57 | function sendStatus(steamID){
58 | var uptime = process.uptime();
59 | client.chatMessage(steamID, `Hey Admin ✋\n\n 🕗Server Uptime : ${format(uptime)}\n 📓Admin ID : ${config.admin}`); //🗒️Comments Length: ${comment.length}
60 | }
61 |
62 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
63 | //LogOn Options
64 |
65 | const logOnOptions = {
66 | accountName : config.username,
67 | password : config.password
68 | };
69 |
70 | util.log("Logged on.");
71 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
72 | //Start
73 |
74 | client.on("loggedOn", function() {
75 |
76 |
77 | console.log(`Logged in as ${config.username} at ${moment().format("DD MMMM YYYY, HH:mm:ss")}\n DeVeLoPeD By 'Zer0Power`);
78 | client.setPersona(SteamUser.EPersonaState.Online, "-/ᴇʟɪ ᴛʜᴇ ᴤʟᴇᴇᴘ ᴅᴇᴀʟᴇʀ");
79 | // client.gamesPlayed("Listening To !help");
80 | client.gamesPlayed(730)
81 |
82 |
83 | })
84 |
85 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
86 | //Command
87 |
88 | client.on("friendMessage", function(steamID, message) {
89 |
90 |
91 | //Prefix Setting =========================================
92 | const Prefix = "!";
93 | if (!message.startsWith(Prefix)) {
94 | client.chatMessage(steamID, "❌Invalid Command, Type !help to see all of my commands")
95 | return;
96 | }
97 | const commandBody = message.slice(Prefix.length);
98 | const args = commandBody.split(' ');
99 | const command = args.shift().toLowerCase();
100 | //=========================================================
101 |
102 | if (command === "status"){
103 | if (config.admin!=steamID){
104 | client.chatMessage(steamID, "⚠️Sorry ,You Are Not Allowed To Use This Command!");
105 | return;
106 | }else{
107 | sendStatus(steamID)
108 | }
109 | }
110 |
111 | if(command === "help"){
112 | client.chatMessage(steamID,`💫 1x1 :\n!random : I'll choose a comment for you =)\n!niceday : Have a nice day\n!heart1 : Random small heart\n!bigheart1 : Random Big heart\n\n💫 6x6 :\n!heart6 : Random small heart\n!bigheart6 : Random big heart\n\n💫 +REP :\n!rep1 : +rep\n!rep2 : +rep Friendly 🤍\n!rep3 : +rep Kind person 🖤\n!rep4 : +rep Good player 💙\n!rep5 : +rep Amazing profile ❤️\n\n!group : Join my group to find new friends.\n`)
113 | }
114 | if (command === "group"){
115 | client.chatMessage(steamID,"🌹Feel Free To join :)\nhttps://steamcommunity.com/groups/Jdm_loverss")
116 | }
117 | //comments ============================================================
118 | if (command === "random") {
119 | const rr = Math.floor(Math.random() * Math.floor(comments.all.length))
120 | postComment(steamID,comments.all[rr])
121 | }
122 | if (command === "niceday"){
123 | const rr = Math.floor(Math.random() * Math.floor(comments.niceday.length))
124 | postComment(steamID,comments.niceday[rr])
125 | }
126 | if (command === "heart1"){
127 | const rr = Math.floor(Math.random() * Math.floor(comments.heart.length))
128 | postComment(steamID,comments.heart[rr])
129 | }
130 | if (command === "bigheart1"){
131 | const rr = Math.floor(Math.random() * Math.floor(comments.bigheart.length))
132 | postComment(steamID,comments.bigheart[rr])
133 | }
134 | //6x6 comments =========================================
135 | if (command === "heart6"){
136 | const rr = Math.floor(Math.random() * Math.floor(comments.heart.length))
137 | let i = 0
138 | while (i<6){
139 | i++
140 | postComment(steamID,comments.heart[rr])
141 | }
142 | }
143 | if (command === "bigheart6"){
144 | const rr = Math.floor(Math.random() * Math.floor(comments.bigheart.length))
145 | let i = 0
146 | while (i<6){
147 | i++
148 | postComment(steamID,comments.bigheart[rr])
149 | }
150 | }
151 | //+Rep Comments =========================================
152 | if (command === "rep1"){
153 | postComment(steamID,comments.rep[0])
154 | }
155 | if (command === "rep2"){
156 | postComment(steamID,comments.rep[1])
157 | }
158 | if (command === "rep3"){
159 | postComment(steamID,comments.rep[2])
160 | }
161 | if (command === "rep4"){
162 | postComment(steamID,comments.rep[3])
163 | }
164 | if (command === "rep5"){
165 | postComment(steamID,comments.rep[4])
166 | }
167 |
168 | });
169 |
170 | client.on('friendRelationship', function(steamID, relationship) {
171 |
172 | client.addFriend(steamID);
173 | client.chatMessage(steamID,"Hellowwwwwww ,Nice to meet you 🌹\n\n\n\nType !help to see all of my commands😇");
174 |
175 | });
176 |
177 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
178 | //webSession
179 |
180 | client.on('webSession', function(sessionid, cookies) {
181 |
182 | manager.setCookies(cookies);
183 |
184 | community.setCookies(cookies);
185 | community.startConfirmationChecker(20000, config.identitySecret);
186 |
187 | });
188 | //---------------------------💔🚬 ᶻᵉʳᵒ༄ᴩᴏᴡᴇʀ💔🚬---------------------------//
189 | //LogOn
190 |
191 | client.logOn(logOnOptions);
192 | client.setOption("PromptSteamGuardCode", false);
--------------------------------------------------------------------------------