Make blockedusers a file
This commit is contained in:
1
blockedusers.txt
Normal file
1
blockedusers.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
1,2,3
|
||||||
7
index.js
7
index.js
@@ -8,6 +8,7 @@ const markov = require('markovchain')
|
|||||||
//Fs because files yay
|
//Fs because files yay
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const slurslist = new RegExp(fs.readFileSync("./1984.txt", "utf8"), "gi")
|
const slurslist = new RegExp(fs.readFileSync("./1984.txt", "utf8"), "gi")
|
||||||
|
const blockedusers = fs.readFileSync("./blockedusers.txt", "utf8").split(',')
|
||||||
|
|
||||||
// Create a new client instance
|
// Create a new client instance
|
||||||
const client = new Client({checkUpdate:false});
|
const client = new Client({checkUpdate:false});
|
||||||
@@ -168,7 +169,7 @@ client.on('messageCreate', (msg) =>{
|
|||||||
if(msg.author.id != client.user.id){
|
if(msg.author.id != client.user.id){
|
||||||
if(msg.guildId != null){
|
if(msg.guildId != null){
|
||||||
console.log("Server")
|
console.log("Server")
|
||||||
if(msg.author.id!="1058783679310209175" || msg.author.id != "825476927284445254"){ //I didnt like these guys (they spammed)
|
if(blockedusers.includes(msg.author.id) == false){ //I didnt like these guys (they spammed)
|
||||||
dlmsg(true, msg.guildId, msg.content)
|
dlmsg(true, msg.guildId, msg.content)
|
||||||
}
|
}
|
||||||
if(msg.mentions.users.get(client.user.id) == undefined){
|
if(msg.mentions.users.get(client.user.id) == undefined){
|
||||||
@@ -195,7 +196,9 @@ client.on('messageCreate', (msg) =>{
|
|||||||
//console.log(msg.channel)
|
//console.log(msg.channel)
|
||||||
if(msg.channel.type=="GROUP_DM"){
|
if(msg.channel.type=="GROUP_DM"){
|
||||||
console.log("gc")
|
console.log("gc")
|
||||||
dlmsg(false, msg.channelId, msg.content)
|
if(blockedusers.includes(msg.author.id) == false){ //I didnt like these guys (they spammed)
|
||||||
|
dlmsg(true, msg.guildId, msg.content)
|
||||||
|
}
|
||||||
if(msg.mentions.users.get(client.user.id) || msg.content.toLowerCase().includes("waffle")){
|
if(msg.mentions.users.get(client.user.id) || msg.content.toLowerCase().includes("waffle")){
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
client.channels.cache.get(msg.channelId).sendTyping()
|
client.channels.cache.get(msg.channelId).sendTyping()
|
||||||
|
|||||||
Reference in New Issue
Block a user