Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return;
}
// If enabled, sync thread channel permissions with the category it's moved to
if (config.syncPermissionsOnMove) {
const newPerms = Array.from(targetCategory.permissionOverwrites.map(ow => {
return {
id: ow.id,
type: ow.type,
allow: ow.allow,
deny: ow.deny
};
}));
try {
await bot.requestHandler.request("PATCH", erisEndpoints.CHANNEL(thread.channel_id), true, {
permission_overwrites: newPerms
});
} catch (e) {
thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}, but failed to sync permissions: ${e.message}`);
return;
}
}
thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}`);
});
};
async action(msg, args) {
const responder = new this.Atlas.structs.Responder(msg);
if (!args.length) {
return responder.embed(this.helpEmbed(msg)).send();
}
const num = this.Atlas.lib.utils.parseNumber(args[0]);
if (this.Atlas.lib.utils.toggleType(args[0], false) === false || num === 0) {
await this.Atlas.client.requestHandler.request('PATCH', Endpoints.CHANNEL(msg.channel.id), true, {
rate_limit_per_user: 0,
});
return responder.text('slowmode.disabled', msg.channel.mention).send();
}
if (isNaN(num)) {
return responder.embed(this.helpEmbed(msg)).send();
}
if (num < 0 || num > 120) {
return responder.error('slowmode.invalid').send();
}
await this.Atlas.client.requestHandler.request('PATCH', Endpoints.CHANNEL(msg.channel.id), true, {
rate_limit_per_user: num,