1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-29 05:35:38 -05:00

Update messageCreate.ts

This commit is contained in:
TÆMBØ 2023-02-16 14:36:39 -08:00
parent de3f4291a6
commit b9a6b4d169

View File

@ -41,10 +41,8 @@ export default {
await client.punishments.addPunishment('mute', { time: '30m' }, (client.user as Discord.User).id, 'Automod; Banned words', message.author, message.member as Discord.GuildMember); await client.punishments.addPunishment('mute', { time: '30m' }, (client.user as Discord.User).id, 'Automod; Banned words', message.author, message.member as Discord.GuildMember);
} }
} else { } else {
client.repeatedMessages[message.author.id] = {data: new client.collection(), timeout: setTimeout(onTimeout, threshold)} client.repeatedMessages[message.author.id] = { data: new client.collection(), timeout: setTimeout(onTimeout, threshold) };
client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 0, ch: message.channelId}); client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 0, ch: message.channelId});
// autodelete after 30 secs
client.repeatedMessages[message.author.id].timeout = setTimeout(onTimeout, threshold);
} }
} }
if (message.content.toLowerCase().includes('discord.gg/') && !message.member.roles.cache.has(client.config.mainServer.roles.dcmod) && message.guildId == client.config.mainServer.id && !Whitelist.includes(message.channelId)) { if (message.content.toLowerCase().includes('discord.gg/') && !message.member.roles.cache.has(client.config.mainServer.roles.dcmod) && message.guildId == client.config.mainServer.id && !Whitelist.includes(message.channelId)) {
@ -67,9 +65,8 @@ export default {
await client.punishments.addPunishment('mute', {time: '1h'}, (client.user as Discord.User).id, 'Automod; Discord advertisement', message.author, message.member as Discord.GuildMember); await client.punishments.addPunishment('mute', {time: '1h'}, (client.user as Discord.User).id, 'Automod; Discord advertisement', message.author, message.member as Discord.GuildMember);
} }
}else{ }else{
client.repeatedMessages[message.author.id].data = new client.collection(); client.repeatedMessages[message.author.id] = { data: new client.collection(), timeout: setTimeout(onTimeout, threshold) };
client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 1, ch: message.channelId}); client.repeatedMessages[message.author.id].data.set(message.createdTimestamp, {cont: 1, ch: message.channelId});
client.repeatedMessages[message.author.id].timeout = setTimeout(onTimeout, threshold);
} }
} }