(hopefully) fix double sending discover notifs
This commit is contained in:
parent
0eb88da2ce
commit
4b0a1786fa
2 changed files with 7 additions and 5 deletions
|
@ -122,6 +122,11 @@ const notifyPublicServers = async () => {
|
||||||
try {
|
try {
|
||||||
logger.info(`Sending notification to owner of server ${serverConfig._id}`);
|
logger.info(`Sending notification to owner of server ${serverConfig._id}`);
|
||||||
|
|
||||||
|
await dbs.SERVERS.update(
|
||||||
|
{ id: serverConfig.id },
|
||||||
|
{ $set: { discoverAutospamNotify: true, antispamEnabled: true, allowBlacklistedUsers: false } },
|
||||||
|
);
|
||||||
|
|
||||||
const server = client.servers.get(serverConfig.id);
|
const server = client.servers.get(serverConfig.id);
|
||||||
const channel = await getDmChannel(server!.owner);
|
const channel = await getDmChannel(server!.owner);
|
||||||
await channel.sendMessage(`Hi there,
|
await channel.sendMessage(`Hi there,
|
||||||
|
@ -135,11 +140,6 @@ Please ensure that AutoMod has appropriate permissions to kick and ban users.
|
||||||
You may also want to set up a logging channel by running \`/botctl logs modaction #yourchannel\` to receive details about antispam events if you haven't done so already.
|
You may also want to set up a logging channel by running \`/botctl logs modaction #yourchannel\` to receive details about antispam events if you haven't done so already.
|
||||||
|
|
||||||
Thanks for being part of Revolt!`);
|
Thanks for being part of Revolt!`);
|
||||||
|
|
||||||
await dbs.SERVERS.update(
|
|
||||||
{ id: serverConfig.id },
|
|
||||||
{ $set: { discoverAutospamNotify: true, antispamEnabled: true, allowBlacklistedUsers: false } },
|
|
||||||
);
|
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ class ServerConfig {
|
||||||
dmOnKick?: boolean; // Whether users should receive a DM when kicked/banned. Default false
|
dmOnKick?: boolean; // Whether users should receive a DM when kicked/banned. Default false
|
||||||
dmOnWarn?: boolean; // Whether users should receive a DM when warned. Default false
|
dmOnWarn?: boolean; // Whether users should receive a DM when warned. Default false
|
||||||
contact?: string; // How to contact the server staff. Sent on kick/ban/warn DMs. http(s)/mailto link or normal text.
|
contact?: string; // How to contact the server staff. Sent on kick/ban/warn DMs. http(s)/mailto link or normal text.
|
||||||
|
|
||||||
|
// TODO: rename this and write a migration for it (this is why you don't code when sleep deprived)
|
||||||
discoverAutospamNotify?: boolean; // Whether we have notified the server owner that antispam is enabled for servers on discover.
|
discoverAutospamNotify?: boolean; // Whether we have notified the server owner that antispam is enabled for servers on discover.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue