-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2896496
commit 972f111
Showing
10 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = async (client, guildId, userId) => { | ||
// Update global count | ||
const { count } = client.db.prepare('SELECT count FROM global_data').get(); | ||
client.db.prepare('UPDATE global_data SET count = ?').run(count + 1); | ||
|
||
// Update user count | ||
const userData = client.db.prepare('SELECT count FROM users WHERE id = ?').get(userId); | ||
const userStatement = userData ? 'UPDATE users SET count = @count WHERE id = @id' : 'INSERT INTO users (id, count) VALUES (@id, @count)'; | ||
client.db.prepare(userStatement).run({ id: userId, count: (userData?.count ?? 1) + 1 }); | ||
|
||
// Update guild count | ||
const guildData = client.db.prepare('SELECT count FROM guilds WHERE id = ?').get(guildId); | ||
const guildStatement = guildData ? 'UPDATE guilds SET count = @count WHERE id = @id' : 'INSERT INTO guilds (id, count) VALUES (@id, @count)'; | ||
client.db.prepare(guildStatement).run({ id: guildId, count: (guildData?.count ?? 1) + 1 }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
["g", "ḡ", "ᵷ", "𝔤", "𝖌", "𝐠", "𝘨", "𝙜", "𝚐", "𝕘", "𝗀", "𝗴", "ɡ", "𝘨", "ℊ", "𝗚", "ᧁ", "ɓ", "⅁", "Ᏽ", "Ꮐ", "Ᏻ", "𝓰", "𝐠", "ᴳ", "❡", "𝙶", "🄶", "𝙂", "𝒢", "🇬", "ᶃ", "ꓖ", "𝖦", "Ꮆ", "ʛ", "𝘎", "Ⴚ", "g", "🅶", "Ꞡ", "𝓖", "🅖", "𝔾", "𝔊", "ꞡ", "𝕲", "𝑔", "ģ", "𝐆", "ƍ", "𝐺", "𝑮", "Ġ", "𝒈", "ꮐ", "ԍ", "ɢ", "ǵ", "ᏻ", "ց", "𝚐", "Ⓖ", "ƃ", "ᘜ", "G", "ᘜ", "Ɠ", "ɢ", "ᶢ", "ᵍ", "₲", "ꍌ", "ꁅ", "Ĝ", "ǧ", "Ğ", "Ǥ", "ᕤ", "ᘓ", "𝞋", "𝟅", "᠖", "ᡋ", "ᠪ"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = async (client, message, database) => { | ||
const levelNames = { 0: 'low', 1: 'medium', 2: 'high' }; | ||
const detect = require(`./levels/${levelNames[database?.level ?? 1]}.js`); | ||
|
||
if (!detect(message.content)) { | ||
return false; | ||
} | ||
|
||
if (message.deletable) { | ||
message.delete(); | ||
} | ||
|
||
if (message.channel.permissionsFor(client.user.id).has('SEND_MESSAGES')) { | ||
message.channel.send(`${message.author}, don't use the bad letter!`).then(m => setTimeout(() => m.delete(), 4000)); | ||
} | ||
|
||
require('./counter.js')(client, message.guildId, message.author.id); | ||
|
||
const logs = client.db.prepare('SELECT logs FROM guilds WHERE id = ?').get(message.guildId)?.logs; | ||
const channel = message.guild.channels.cache.get(logs); | ||
|
||
channel?.send({ | ||
embeds: [{ | ||
title: 'G Removal', | ||
url: 'https://h-projects.github.io/app/fuck-g/', | ||
color: client.config.color, | ||
fields: [ | ||
{ name: 'Type', value: 'Messaqe' }, | ||
{ name: 'User', value: `${message.author} (${message.author.id})` }, | ||
{ name: 'Channel', value: `${message.channel} (${message.channelId})` }, | ||
{ name: 'Content', value: message.content } | ||
], | ||
thumbnail: { | ||
url: message.author.displayAvatarURL({ dynamic: true }) | ||
} | ||
}] | ||
}); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = content => { | ||
const badLetters = require('../detection.json').join(''); | ||
return RegExp(`[${badLetters}]`, 'iu').test(content); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = content => { | ||
const badLetters = require('../detection.json').join(''); | ||
return !RegExp(`[^\\s${badLetters}]`, 'iu').test(content); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = content => { | ||
const badLetters = require('../detection.json').join(''); | ||
const lowDetection = require('./low.js'); | ||
return RegExp(`(\\s[${badLetters}]+\\s)|(^[${badLetters}]+\\s)|(\\s[${badLetters}]+$)`, 'iu').test(content) || lowDetection(content); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters