thaldrin/DiscordEvents/MessageSourceFynnder.js

38 lines
837 B
JavaScript
Raw Permalink Normal View History

const {
log,
db
} = require("../utils/index");
const {
2020-01-18 14:45:03 +00:00
SourceFynnder: {
SourceFynnder
},
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");
2020-01-18 14:45:03 +00:00
2019-10-14 11:19:41 +00:00
module.exports = {
name: "message",
run: async (client, Message) => {
if (Message.author.bot) return;
2020-02-16 21:27:14 +00:00
/* let UserFromDB = await db.blacklist(Message.author.id, 's')
if (UserFromDB.state) return;
2020-02-16 21:27:14 +00:00
*/
2020-02-16 21:29:41 +00:00
//if (topic.includesSetting('thaldrin.no-SF', 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.SourceFynnder;
} else {
Enabled = Server.SourceFynnder;
}
2020-02-16 21:34:23 +00:00
SourceFynnder(Enabled = true, Message);
2019-10-14 11:19:41 +00:00
}
};