rotate avatars from a folder with fs watch

This commit is contained in:
2026-02-14 02:45:39 -05:00
committed by Cesium
parent fe7b30908e
commit d3cbd29482
6 changed files with 84 additions and 3 deletions

View File

@@ -68,6 +68,8 @@ client.on(Events.InteractionCreate, async interaction => {
client.once(Events.ClientReady, readyClient => {
console.log(`Discord: Connected as ${readyClient.user.tag}`);
client.user.setActivity(config.status, { type: ActivityType.Custom });
const avatarRotation = require('./lib/avatarRotation');
avatarRotation.init(client);
});
client.login(config.token);
@@ -78,6 +80,7 @@ client.on(Events.MessageCreate, message => {
if (regexProfile) {
const cocklink = convertURL(regexProfile[0], twitterRegex, "girlcockx.com")
message.channel.send({ content: cocklink, flags: MessageFlags.SuppressNotifications, components: [swapRow] })
.catch(err => console.error("Failed to send converted link: " + (err.message || err)))
message.suppressEmbeds().catch(err =>
// this next bit just cuts down the error to the important part, which will usually end up being "no permissions"
console.error("Removing original embed failed: " + err.stack?.split('\n')[0] || err.message || String(err).split('\n')[0])