34 lines
819 B
JavaScript
34 lines
819 B
JavaScript
|
const { Observer } = require("../../../interfaces");
|
||
|
|
||
|
class RestrictedChannels extends Observer {
|
||
|
|
||
|
constructor(client) {
|
||
|
|
||
|
super(client, {
|
||
|
name: 'restrictedChannels',
|
||
|
priority: 0,
|
||
|
disabled: false
|
||
|
});
|
||
|
|
||
|
this.client = client;
|
||
|
|
||
|
this.hooks = [
|
||
|
['message', this.message.bind(this)]
|
||
|
];
|
||
|
|
||
|
}
|
||
|
|
||
|
async message(message) {
|
||
|
const { imageOnly } = await message.guild.settings();
|
||
|
if(!imageOnly.channels) return undefined;
|
||
|
if(imageOnly.channels.includes(message.channel.id)) {
|
||
|
if(message.attachments.size === 0 && message.embeds.length === 0) {
|
||
|
this.client.rateLimiter.queueDelete(message.channel, message);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
module.exports = RestrictedChannels;
|