Tetobot4000/communicator.js
2024-11-19 18:47:58 -06:00

22 lines
No EOL
553 B
JavaScript

const bot = require("./bot")
const { Client, Events, GatewayIntentBits } = require("discord.js")
const token = process.env.BOT_TOKEN
const client = new Client({ intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent
] })
client.once(Events.ClientReady, readyClient => {
console.log("Tetobot is ready! Logged in as " + readyClient.user.tag)
})
client.on(Events.MessageCreate, message => {
if (message.author != client.id) {
bot.message(message)
}
})
client.login(token)