harmony/test/chunk.ts

28 lines
687 B
TypeScript
Raw Normal View History

2021-04-04 05:52:47 +00:00
import { Client, Intents } from '../mod.ts'
2021-01-01 04:48:18 +00:00
import { TOKEN } from './config.ts'
const client = new Client()
client.on('debug', console.log)
client.on('ready', () => {
console.log(`Logged in as ${client.user?.tag}!`)
})
client.on('guildLoaded', async (guild) => {
if (guild.id !== '783319033205751809') return
const arr = await guild.channels.array()
console.log(arr.length)
guild
.chunk({ presences: true }, true)
.then((guild) => {
console.log(`Chunked guild:`, guild.id)
})
.catch((e) => {
console.log(`Failed to Chunk: ${guild.id} - ${e}`)
})
2021-01-01 04:48:18 +00:00
})
console.log('Connecting...')
client.connect(TOKEN, Intents.All)