How To add blacklist to send in discord server

How do you blacklist from servers? is there like

BlacklistDiscordServer(‘server ID here’)
please help me!

you can do if(message.guild.id === "server id goes here") return;

1 Like

very good answer @Daniel and to both of you, welcome to the glitch support forums!

1 Like

sorry but will this work? `client.on(‘message’, msg => {

if (msg.content === ‘j4j’) {
msg.reply(':regional_indicator_j: :four: :regional_indicator_j: <a:Cheers:524894732611223552> DM me! ')
(message.guild.id === “627490449870946315”) return;
}
})`

It won’t work…

sorry i ment

client.on(‘message’, msg => {

if (msg.content === ‘j4j’) {
msg.reply(':regional_indicator_j: :four: :regional_indicator_j: <a:Cheers:524894732611223552> DM me! ')
(message.guild.id === “627490449870946315”) return;
}
})

you have it in the wrong spot, right under the client.on line, put

if (msg.guild.id === "BLACKLIST_ID_HERE") return;
//other code down here

sorry again but wont work can you please correct this?

client.on(‘message’, msg => {

if (msg.guild.id === “627490449870946315”) return;
(msg.content === ‘j4j’) {
msg.reply(‘:regional_indicator_j: :four: :regional_indicator_j: <a:Cheers:524894732611223552> Here is the invite link! Discord’)

  }

})

odd…

idk then
sorry

is there a whitelist then? thatl work still fine

yes, but it takes up MUCH more memory, something like html-db would be useful for automatic pushing new servers to a json whitelist

what error are you getting? @TH3_UNKNOWN

If you use mongo you won’t have that issue. If you use glitch for your primary hosting you will need to move from json to avoid having to purge those json files

true

BUT, if html-db does get popular again, i will add an encryption system to “minify” the json databases, to a new type of database, html db will be extremely useful in this situation

I dont need it anymore but thanks!