Im not even using async there
This commit is contained in:
parent
9f8b65ff47
commit
9288fbc433
8
index.js
8
index.js
|
@ -125,7 +125,7 @@ function updateDefcon(level) {
|
||||||
function updateSlowmodes() {
|
function updateSlowmodes() {
|
||||||
if (defcon >= 3) {
|
if (defcon >= 3) {
|
||||||
// Disable slowmodes
|
// Disable slowmodes
|
||||||
slowmode_categories.forEach(async (category) => {
|
slowmode_categories.forEach((category) => {
|
||||||
category.category.guild.channels.cache.forEach((chan) => {
|
category.category.guild.channels.cache.forEach((chan) => {
|
||||||
if (chan.parentId == category.category.id) {
|
if (chan.parentId == category.category.id) {
|
||||||
if (chan.rateLimitPerUser != category.defaultTime) chan.setRateLimitPerUser(category.defaultTime);
|
if (chan.rateLimitPerUser != category.defaultTime) chan.setRateLimitPerUser(category.defaultTime);
|
||||||
|
@ -133,12 +133,12 @@ function updateSlowmodes() {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
slowmode_channels.forEach(async (channel) => {
|
slowmode_channels.forEach((channel) => {
|
||||||
if (channel.channel.rateLimitPerUser != channel.defaultTime) return channel.channel.setRateLimitPerUser(channel.defaultTime);
|
if (channel.channel.rateLimitPerUser != channel.defaultTime) return channel.channel.setRateLimitPerUser(channel.defaultTime);
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
// Enable slowmodes
|
// Enable slowmodes
|
||||||
slowmode_categories.forEach(async (category) => {
|
slowmode_categories.forEach((category) => {
|
||||||
category.category.guild.channels.cache.forEach((chan) => {
|
category.category.guild.channels.cache.forEach((chan) => {
|
||||||
if (chan.parentId == category.category.id) {
|
if (chan.parentId == category.category.id) {
|
||||||
if (chan.rateLimitPerUser != category.time) chan.setRateLimitPerUser(category.time);
|
if (chan.rateLimitPerUser != category.time) chan.setRateLimitPerUser(category.time);
|
||||||
|
@ -146,7 +146,7 @@ function updateSlowmodes() {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
slowmode_channels.forEach(async (channel) => {
|
slowmode_channels.forEach((channel) => {
|
||||||
if (channel.channel.rateLimitPerUser != channel.time) return channel.channel.setRateLimitPerUser(channel.time);
|
if (channel.channel.rateLimitPerUser != channel.time) return channel.channel.setRateLimitPerUser(channel.time);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue