-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
171 lines (145 loc) · 5.49 KB
/
main.go
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
package main
import (
"bufio"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"sync"
)
var (
client = &http.Client{}
wg sync.WaitGroup
)
func setTitle(title string) {
// Function to set the console title
fmt.Printf("\033]0;%s\007", title)
}
func clear() {
// Function to clear the console screen
fmt.Print("\033[H\033[2J")
}
func joinServer(token, inv string) {
defer wg.Done()
req, _ := http.NewRequest("POST", "https://discord.com/api/v9/invites/"+inv, nil)
req.Header.Set("Authorization", token)
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9001 Chrome/83.0.4103.122 Electron/9.3.5 Safari/537.36")
req.Header.Set("accept", "*/*")
req.Header.Set("accept-language", "en-US")
req.Header.Set("cookie", "__cfduid="+randomString(43)+"; __dcfduid="+randomString(32)+"; locale=en-US")
req.Header.Set("DNT", "1")
req.Header.Set("origin", "https://discord.com")
req.Header.Set("sec-fetch-dest", "empty")
req.Header.Set("sec-fetch-mode", "cors")
req.Header.Set("sec-fetch-site", "same-origin")
req.Header.Set("referer", "https://discord.com/channels/@me")
req.Header.Set("TE", "Trailers")
req.Header.Set("X-Super-Properties", "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAxIiwib3NfdmVyc2lvbiI6IjEwLjAuMTkwNDIiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6ODMwNDAsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9")
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Failed To Join Server: %v\n", err)
return
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNoContent || resp.StatusCode == http.StatusCreated {
fmt.Println("Successfully Joined Server")
} else {
fmt.Printf("Failed To Join Server, Status Code: %d\n", resp.StatusCode)
}
}
func boostServer(guildID, token string) {
defer wg.Done()
req, _ := http.NewRequest("PUT", "https://discord.com/api/v9/guilds/"+guildID+"/premium/subscriptions", strings.NewReader(`{"user_premium_guild_subscription_slot_ids":["`+guildID+`"]}`))
req.Header.Set("Authorization", token)
req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) discord/1.0.9001 Chrome/83.0.4103.122 Electron/9.3.5 Safari/537.36")
req.Header.Set("accept", "*/*")
req.Header.Set("accept-language", "en-US")
req.Header.Set("cookie", "__cfduid="+randomString(43)+"; __dcfduid="+randomString(32)+"; locale=en-US")
req.Header.Set("DNT", "1")
req.Header.Set("origin", "https://discord.com")
req.Header.Set("sec-fetch-dest", "empty")
req.Header.Set("sec-fetch-mode", "cors")
req.Header.Set("sec-fetch-site", "same-origin")
req.Header.Set("referer", "https://discord.com/channels/@me")
req.Header.Set("TE", "Trailers")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Super-Properties", "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiRGlzY29yZCBDbGllbnQiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfdmVyc2lvbiI6IjEuMC45MDAxIiwib3NfdmVyc2lvbiI6IjEwLjAuMTkwNDIiLCJvc19hcmNoIjoieDY0Iiwic3lzdGVtX2xvY2FsZSI6ImVuLVVTIiwiY2xpZW50X2J1aWxkX251bWJlciI6ODMwNDAsImNsaWVudF9ldmVudF9zb3VyY2UiOm51bGx9")
resp, err := client.Do(req)
if err != nil {
fmt.Printf("Failed To Boost Server: %v\n", err)
return
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
fmt.Println("Successfully Boosted Server")
} else {
fmt.Printf("Failed To Boost Server, Status Code: %d\n", resp.StatusCode)
}
}
func startJoin(inv string) {
setTitle("Server Joiner - [Blust#9380]")
fmt.Printf("Joining servers for invite code: %s\n", inv)
file, err := os.Open("tokens.txt")
if err != nil {
fmt.Printf("Error opening tokens file: %v\n", err)
return
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
token := scanner.Text()
wg.Add(1)
go joinServer(token, inv)
}
wg.Wait()
}
func startBoost(id string) {
setTitle("Server Booster - [Blust#9380]")
fmt.Printf("Boosting server with ID: %s\n", id)
file, err := os.Open("tokens.txt")
if err != nil {
fmt.Printf("Error opening tokens file: %v\n", err)
return
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
token := scanner.Text()
wg.Add(1)
go boostServer(id, token)
}
wg.Wait()
}
func randomString(length int) string {
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
result := make([]byte, length)
for i := range result {
result[i] = chars[rand.Intn(len(chars))]
}
return string(result)
}
func main() {
clear()
fmt.Println("Server Tool")
fmt.Println("--------------------------------")
fmt.Println("[1] Server Joiner")
fmt.Println("[2] Server Booster")
var choice string
fmt.Print("Choice: ")
fmt.Scanln(&choice)
switch choice {
case "1":
var inviteCode string
fmt.Print("Enter Invite Code: discord.gg/")
fmt.Scanln(&inviteCode)
startJoin(inviteCode)
case "2":
var guildID string
fmt.Print("Enter Guild ID: ")
fmt.Scanln(&guildID)
startBoost(guildID)
default:
fmt.Println("Invalid Choice")
}
}