mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
Bleh
This commit is contained in:
parent
db7e46b463
commit
c3f4967224
1 changed files with 15 additions and 9 deletions
|
@ -27,16 +27,12 @@ const settings = definePluginSettings({
|
||||||
|
|
||||||
const isLegal = (word: string) => {
|
const isLegal = (word: string) => {
|
||||||
if (word.startsWith("<@")) return false;
|
if (word.startsWith("<@")) return false;
|
||||||
|
if (word.endsWith("ington")) return false;
|
||||||
if (/^https?:\/\//i.test(word)) return false;
|
if (/^https?:\/\//i.test(word)) return false;
|
||||||
if (word.length < 4) return false;
|
if (/[aeouy]$/i.test(word)) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const ingtonize = (word: string) => {
|
|
||||||
return word.endsWith("ton") ? word + "ton" : word + "ington";
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMessage = ((channelId, message) => {
|
const handleMessage = ((channelId, message) => {
|
||||||
if (!settings.store.isEnabled) return;
|
if (!settings.store.isEnabled) return;
|
||||||
if (!message.content || !message.content.trim()) return;
|
if (!message.content || !message.content.trim()) return;
|
||||||
|
@ -53,9 +49,19 @@ const handleMessage = ((channelId, message) => {
|
||||||
|
|
||||||
if (isLegal(words[index])) {
|
if (isLegal(words[index])) {
|
||||||
const word = words[index];
|
const word = words[index];
|
||||||
words[index] = word.endsWith("ing")
|
if (word.endsWith("ing")) {
|
||||||
? (word === word.toUpperCase() ? word + "TON" : word + "ton")
|
words[index] = word === word.toUpperCase() ? word + "TON" : word + "ton";
|
||||||
: word;
|
} else if (word.endsWith("i") || word.endsWith("I")) {
|
||||||
|
words[index] = word === word.toUpperCase() ? word + "NGTON" : word + "ngton";
|
||||||
|
} else if (word.endsWith("in") || word.endsWith("IN")) {
|
||||||
|
words[index] = word === word.toUpperCase() ? word + "GTON" : word + "gton";
|
||||||
|
} else if (word.endsWith("ing") || word.endsWith("ING")) {
|
||||||
|
words[index] = word === word.toUpperCase() ? word + "TON" : word + "ton";
|
||||||
|
} else if (word.endsWith("ingt") || word.endsWith("INGT")) {
|
||||||
|
words[index] = word === word.toUpperCase() ? word + "ON" : word + "on";
|
||||||
|
} else {
|
||||||
|
words[index] = word === word.toUpperCase() ? word + "INGTON" : word + "ington";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message.content = words.join(" ");
|
message.content = words.join(" ");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue