import client, { rest } from "@/discord"; import config from "../src/config.ts"; import { codeBlock, Events, Routes } from "discord.js"; await client.login(config.discord.token) client.on(Events.ClientReady, async (client) => { const servers = await client.guilds.fetch() console.log(`You are in ${servers.size} servers!`) for (const [id, server] of servers) { console.log(id, server.name) const channels = await client.guilds.cache.get(id)?.channels.fetch() if (!channels) continue for (const [id, channel] of channels) { // console.log(`\t${id}, ${channel?.name}`) if (id === "1478940790112915486") { if (!channel?.isSendable()) continue // await channel.send("??? that returned an error but the message did go through good job discord") const messages = await channel.messages.fetch({ limit: 100 }) for (const [id, message] of messages) { console.log(`${message.author.tag} ${message.content}`) } } } } })