rotate avatars from a folder with fs watch
This commit is contained in:
3
index.js
3
index.js
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user