This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 100
/
index.js
92 lines (75 loc) · 2.23 KB
/
index.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//Dependencies
const Discord = require("discord.js-selfbot-v11")
const Request = require("request")
const Delay = require("delay")
const Fs = require("fs")
//Variables
const Self_Args = process.argv.slice(2)
const User = new Discord.Client()
//Main
if(!Self_Args.length){
console.log(`node index.js <discord_token> <dictionary> <changing_delay(seconds)>
Example: node index.js yourdiscordtoken dictionary_test.txt 5`)
process.exit()
}
if(!Self_Args[0]){
console.log("Invalid discord_token.")
process.exit()
}
if(!Self_Args[1]){
console.log("Invalid dictionary.")
process.exit()
}
if(!Self_Args[2]){
console.log("Invalid changing_delay.")
process.exit()
}
if(isNaN(Self_Args[2])){
console.log("Invalid changing_delay, changing_delay is not an Int.")
process.exit()
}
if(Self_Args[2] < 5){
console.log("Invalid changing_delay, minimum is 5.")
process.exit()
}
const Dictionary = Fs.readFileSync(Self_Args[1], "utf8").split("\n")
if(!Dictionary){
console.log("Invalid dictionary.")
process.exit()
}
var self_index = 0
User.on("ready", function(){
console.log("Status message changer is running.")
Looper()
async function Looper(){
if(self_index == Dictionary.length){
self_index = 0
}
await Delay(Self_Args[2] * 1000)
Request.patch("https://discord.com/api/v9/users/@me/settings", {
headers: {
"Content-Type": "application/json",
"Authorization": Self_Args[0]
},
"body": JSON.stringify({ "custom_status": { "text" : Dictionary[self_index] } })
}, function(err, res, body){
if(err){
console.log(`Unable to change to ${Dictionary[self_index-1]}`)
self_index += 1
Looper()
return
}
if(res.statusCode == 200 || body.indexOf('"locale":') != -1){
console.log(`Changed to ${Dictionary[self_index-1]}`)
}else{
console.log(`Unable to change to ${Dictionary[self_index-1]}`)
}
})
self_index += 1
Looper()
}
})
User.login(Self_Args[0]).catch(()=>{
console.log("Invalid discord_token.")
process.exit()
})