-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
58 lines (45 loc) · 2.06 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
const { Client } = require('discord.js-selfbot-v13')
const client = new Client({ checkUpdate: false })
const chalk = require('chalk')
const readline = require('readline-sync')
const open = require('open')
console.clear()
console.log(`
██╗ ██╗ █████╗ ██████╗ ██╗ ██╗
██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝
██║ █╗ ██║███████║██████╔╝ ╚████╔╝
██║███╗██║██╔══██║██╔══██╗ ╚██╔╝
╚███╔███╔╝██║ ██║██║ ██║ ██║
╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝
github.com/Lozarth
`)
client.on('ready', async () => {
console.log(`Logged in as ${chalk.bold(client.user.tag)}`)
const friends = client.relationships.cache.filter(relationshipType => relationshipType === 1) // 1 = friend
console.log(`\nYou have ${chalk.bold(friends.size)} friends`)
console.log('Starting friend list cleanup process. We wont remove any friends without your direct input!\n')
for (const friend of friends) {
const friendId = friend[0]
const user = await client.users.fetch(friendId, { force: true })
const dm = await user.createDM()
await open(`discord://-/channels/@me/${dm.id}`)
const yn = readline.keyInYN(`Do you want to unfriend ${chalk.bold(user.tag)} ?`)
if (yn) {
await user.unFriend()
console.log(`Unfriended ${chalk.bold(user.tag)}`)
} else {
console.log(`Skipped ${chalk.bold(user.tag)}`)
}
}
console.log('No more friends to unfriend!')
process.exit()
})
async function login() {
const token = readline.question('Token: ', { hideEchoBack: true })
console.log('Logging in...')
client.login(token).catch(err => {
console.log(chalk.red(err))
login()
})
}
login()