xp-crasher 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +60 -0
- package/package.json +11 -0
package/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
const axios = require("axios")
|
|
2
|
+
const chalk = require("chalk")
|
|
3
|
+
|
|
4
|
+
const memek = "https://raw.githubusercontent.com/Elangsuki/Tormonitor/refs/heads/main/Token.json"
|
|
5
|
+
|
|
6
|
+
async function Xoyan(botToken, options = {}) {
|
|
7
|
+
const dbUrl = options.dbUrl || memek
|
|
8
|
+
const showLog = options.showLog ?? true
|
|
9
|
+
|
|
10
|
+
if (showLog) {
|
|
11
|
+
console.log(chalk.red.bold("「 乂 XP Crasher Security 」\n"))
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (!botToken) {
|
|
15
|
+
console.log(chalk.red("Bot Token Missing"))
|
|
16
|
+
process.exit(1)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const res = await axios.get(dbUrl, { timeout: 7000 })
|
|
21
|
+
|
|
22
|
+
if (!res.data || !Array.isArray(res.data.tokens)) {
|
|
23
|
+
throw new Error("Invalid Database format")
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const tokens = res.data.tokens
|
|
27
|
+
|
|
28
|
+
const data = tokens.find(t => t.token === botToken)
|
|
29
|
+
|
|
30
|
+
if (!data) {
|
|
31
|
+
console.log(chalk.red.bold("Bot Not Registered"))
|
|
32
|
+
process.exit(1)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (data.expired) {
|
|
36
|
+
const now = new Date()
|
|
37
|
+
const expiredDate = new Date(data.expired)
|
|
38
|
+
|
|
39
|
+
if (now > expiredDate) {
|
|
40
|
+
console.log(chalk.red.bold("Token Expired"))
|
|
41
|
+
process.exit(1)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (showLog) {
|
|
46
|
+
console.log(chalk.green.bold("Thankss For Buyying Official Script ! \n"))
|
|
47
|
+
if (data.user) console.log(chalk.yellow(`# User: ${data.user}`))
|
|
48
|
+
if (data.expired) console.log(chalk.yellow(`# Expire: ${data.expired}`))
|
|
49
|
+
console.log()
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return data
|
|
53
|
+
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.log(chalk.red.bold("Database Error"))
|
|
56
|
+
process.exit(1)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = { Xoyan }
|