2020-01-03 16:27:32 +00:00
|
|
|
const {
|
|
|
|
log,
|
|
|
|
db
|
|
|
|
} = require("../utils/index");
|
|
|
|
const {
|
|
|
|
ShortLinks,
|
|
|
|
topic
|
|
|
|
} = require("../utils");
|
|
|
|
const {
|
|
|
|
table
|
|
|
|
} = require("quick.db");
|
2019-10-14 11:19:41 +00:00
|
|
|
const Servers = new table("servers");
|
|
|
|
const Users = new table("users");
|
|
|
|
const Backend = new table("backend");
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: "message",
|
|
|
|
run: async (client, Message) => {
|
|
|
|
if (Message.author.bot) return;
|
2020-01-03 16:27:32 +00:00
|
|
|
|
|
|
|
let UserFromDB = await db.blacklist(Message.author.id, 's')
|
|
|
|
if (UserFromDB.state) return;
|
|
|
|
if (topic.includesSetting('thaldrin.no-SL', Message.channel.topic)) return;
|
|
|
|
|
|
|
|
|
2019-10-14 11:19:41 +00:00
|
|
|
let Server = Servers.get(Message.guild.id);
|
|
|
|
let Enabled;
|
|
|
|
if (Server === null) {
|
|
|
|
Enabled = db.defaults.server.Shortlinks;
|
|
|
|
} else {
|
|
|
|
Enabled = Server.Shortlinks;
|
|
|
|
}
|
|
|
|
ShortLinks(Enabled, Message);
|
|
|
|
}
|
2020-01-03 16:27:32 +00:00
|
|
|
};
|