-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (26 loc) · 1.16 KB
/
Copy pathindex.js
File metadata and controls
32 lines (26 loc) · 1.16 KB
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
const {Client} = require('discord.js-selfbot-v13')
const client = new Client()
const token = ''
const categoryId = '1301518760544440362'
const botId = '1292485854916378795'
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`)
})
client.login(token)
client.on('channelCreate', async(channel) => {
if (channel.type !== 'GUILD_TEXT') return console.log('No channel type')
if (channel.parentId !== categoryId) return console.log('No category');
if (!channel.name.startsWith('c2p')) return console.log('No name');
setTimeout(async() => {
const msg = await channel.messages.fetch({limit: 2})
let filtered = msg.filter((c) => c.author.id === botId)
if (filtered.size === 0) return console.log('error no message');
filtered = filtered.filter((c) => c.type === "DEFAULT")
if (filtered.size === 0) return console.log('error no message 2');
const message = filtered.map((c) => c)[0]
const button = message.components[0].components[0]
if (!button) return console.log('error no button');
await message.clickButton({ X: 0, Y: 0})
console.log('clicked')
}, 3000)
})