2023-04-28 07:48:43 -04:00
|
|
|
const client = require("../index");
|
2023-05-24 04:31:35 -04:00
|
|
|
const { EmbedBuilder, ActivityType } = require('discord.js');
|
2023-04-28 07:48:43 -04:00
|
|
|
|
|
|
|
|
|
|
|
client.on("ready", () => {
|
|
|
|
console.log(`${client.user.tag} is up and ready to go!`);
|
|
|
|
|
|
|
|
// set the status to do not disturb
|
|
|
|
// client.user.setStatus('dnd')
|
2023-05-24 04:31:35 -04:00
|
|
|
// client.user.setPresence({
|
|
|
|
// activities: [{ name: `over msgs for certain letters`, type: ActivityType.Watching }],
|
|
|
|
// status: 'dnd',
|
|
|
|
// });
|
|
|
|
|
|
|
|
client.user.setPresence({
|
|
|
|
activities: [{ name: `RIP #1123`, type: ActivityType.Playing }],
|
2023-04-28 07:48:43 -04:00
|
|
|
status: 'dnd',
|
|
|
|
});
|
2023-05-24 04:31:35 -04:00
|
|
|
|
|
|
|
// Function to convert RGB to hex
|
|
|
|
function convertToHex(rgb) {
|
|
|
|
// Extract the RGB values using a regex pattern
|
|
|
|
const rgbValues = rgb.match(/\d+/g);
|
|
|
|
|
|
|
|
// Convert each RGB value to a hexadecimal string
|
|
|
|
const hexValues = rgbValues.map((value) => {
|
|
|
|
// Convert the value to a number
|
|
|
|
const intValue = parseInt(value);
|
|
|
|
|
|
|
|
// Convert the number to a hexadecimal string
|
|
|
|
const hexString = intValue.toString(16);
|
|
|
|
|
|
|
|
// Pad the string with zero if needed
|
|
|
|
return hexString.padStart(2, '0');
|
|
|
|
});
|
|
|
|
|
|
|
|
// Return the hex color string
|
|
|
|
return `#${hexValues.join('')}`;
|
|
|
|
};
|
|
|
|
|
|
|
|
const readyEmbed = new EmbedBuilder()
|
|
|
|
.setTitle('Now online!')
|
|
|
|
.setColor(convertToHex('rgb(119, 152, 229)'))
|
|
|
|
.setAuthor({ name: client.user.tag, iconURL: client.user.avatarURL() })
|
|
|
|
.setTimestamp()
|
|
|
|
.setDescription(`${client.user.tag} is nu online`);
|
|
|
|
|
|
|
|
// client.channels.cache.get(`967754078438449192`).send(`${client.user.tag} is nu online.`);
|
|
|
|
client.channels.cache.get(`967754078438449192`).send({ embeds: [readyEmbed] })
|
|
|
|
|
2023-04-28 07:48:43 -04:00
|
|
|
});
|