Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ShrekSauce authored May 31, 2024
1 parent c99cbbb commit dae310e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const { Client, GatewayIntentBits } = require('discord.js');
const cron = require('node-cron');
console.log(process.env.BOT_TOKEN);
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages] });

client.once('ready', () => {
console.log('Ready!');

// Schedule a daily thread creation at 5 AM
cron.schedule('0 5 * * *', () => {
cron.schedule('0 16 * * *', () => {
const guild = client.guilds.cache.get(process.env.GUILD_ID);
const channel = guild.channels.cache.get(process.env.CHANNEL_ID);
// Generate today's date string
Expand All @@ -22,5 +21,4 @@ client.once('ready', () => {
.catch(console.error);
});
});
console.log(process.env.BOT_TOKEN);
client.login(process.env.BOT_TOKEN);

0 comments on commit dae310e

Please sign in to comment.