Skip to content
Snippets Groups Projects
Commit ca4e6a16 authored by Reviath's avatar Reviath
Browse files

Fixed link-block

parent 6492ec74
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,17 @@ module.exports = {
message: (client, settings, Discord, connection) => {
client.on('message', async message => {
var linkblock = "";
const link = await new Promise((resolve, reject) => {
connection.query(`SELECT isblocked FROM linkblock WHERE guildid ='${message.guild.id}'`, function (err, result) {
if (err) throw err;
if (result.length < 1) return;
else {
if (err)
reject(err);
resolve(result);
});
});
if (link.length > 0) {
linkblock = "deny"
}
});
if(linkblock == "deny") {
const reklam = [
".ml",
......@@ -41,7 +45,7 @@ module.exports = {
if (reklam.some(word => message.content.toLowerCase().includes(word))) {
if (!message.member.hasPermission("ADMINISTRATOR")) {
message.channel.send(`<@${message.author.id}> you are not allowed to send links on this server!`)
message.channel.send(`${message.author} you are not allowed to send links on this server!`)
message.delete();
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment