diff --git a/example/banend-words.ts b/example/banend-words.ts new file mode 100644 index 0000000..a68459c --- /dev/null +++ b/example/banend-words.ts @@ -0,0 +1,21 @@ +import "dotenv/config"; +import { Midjourney, detectBannedWords } from "../src"; +/** + * + * a simple example of how to use the banned words + * ``` + * npx tsx example/banend-words.ts + * ``` + */ +async function main() { + var prompt = "horny girl"; + var message = detectBannedWords(prompt); + if (message.length > 0) { + console.error("banned words detected"); + } + console.log(message); +} +main().catch((err) => { + console.error(err); + process.exit(1); +}); diff --git a/src/banned.words.ts b/src/banned.words.ts new file mode 100644 index 0000000..9592796 --- /dev/null +++ b/src/banned.words.ts @@ -0,0 +1,228 @@ +// https://tokenizedhq.com/list-of-banned-words-in-midjourney/ +// https://www.greataiprompts.com/imageprompt/list-of-banned-words-in-midjourney/ +export const bannedWords = [ + "blood", + "twerk", + "making love", + "voluptuous", + "naughty", + "wincest", + "orgy", + "no clothes", + "au naturel", + "no shirt", + "decapitate", + "bare", + "nude", + "barely dressed", + "nude", + "bra", + "risque", + "scantily clad", + "cleavage", + "stripped", + "infested", + "full frontal", + "unclothed", + "invisible clothes", + "wearing nothing", + "lingerie", + "with no shirt", + "naked", + "without clothes on", + "negligee", + "zero clothes", + "gruesome", + "fascist", + "nazi", + "prophet mohammed", + "slave", + "coon", + "honkey", + "cocaine", + "heroin", + "meth", + "crack", + "kill", + "belle delphine", + "hitler", + "jinping", + "lolita", + "president xi", + "torture", + "disturbing", + "farts", + "fart", + "poop", + "infected", + "warts", + "shit", + "brown pudding", + "bunghole", + "vomit", + "voluptuous", + "seductive", + "sperm", + "sexy", + "sadist", + "sensored", + "censored", + "silenced", + "deepfake", + "inappropriate", + "waifu", + "succubus", + "slaughter", + "surgery", + "reproduce", + "crucified", + "seductively", + "explicit", + "inappropriate", + "large bust", + "explicit", + "wang", + "inappropriate", + "teratoma", + "intimate", + "see through", + "tryphophobia", + "bloodbath", + "wound", + "cronenberg", + "khorne", + "cannibal", + "cannibalism", + "visceral", + "guts", + "bloodshot", + "gory", + "killing", + "crucifixion", + "surgery", + "vivisection", + "massacre", + "hemoglobin", + "suicide", + "arse", + "labia", + "ass", + "mammaries", + "badonkers", + "bloody", + "minge", + "big ass", + "mommy milker", + "booba", + "nipple", + "oppai", + "booty", + "organs", + "bosom", + "ovaries", + "flesh", + "breasts", + "penis", + "busty", + "phallus", + "clunge", + "sexy female", + "crotch", + "skimpy", + "dick", + "thick", + "bruises", + "girth", + "titty", + "honkers", + "vagina", + "hooters", + "veiny", + "knob", + "ahegao", + "pinup", + "ballgag", + "car crash", + "playboy", + "bimbo", + "pleasure", + "bodily fluids", + "pleasures", + "boudoir", + "rule34", + "brothel", + "seducing", + "dominatrix", + "corpse", + "seductive", + "erotic", + "seductive", + "fuck", + "sensual", + "hardcore", + "sexy", + "hentai", + "shag", + "horny", + "crucified", + "shibari", + "incest", + "smut", + "jav", + "succubus", + "jerk off king at pic", + "thot", + "kinbaku", + "legs spread", + "sensuality", + "belly button", + "porn", + "patriotic", + "bleed", + "excrement", + "petite", + "seduction", + "mccurry", + "provocative", + "sultry", + "erected", + "camisole", + "tight white", + "arrest", + "see-through", + "feces", + "anus", + "revealing clothing", + "vein", + "loli", + "-edge", + "boobs", + "-backed", + "tied up", + "zedong", + "bathing", + "jail", + "reticulum", + "rear end", + "sakimichan", + "behind bars", + "shirtless", + "sakimichan", + "seductive", + "sexi", + "sexualiz", + "sexual", +]; +export function detectBannedWords(prompt: string): string[] { + const matches: string[] = []; + bannedWords.forEach((word) => { + const regex = new RegExp(`\\b${word}\\b`, "gi"); + const wordMatches = prompt.match(regex); + if (wordMatches) { + wordMatches.forEach((match) => { + matches.push(match); + }); + } + }); + return matches; +} diff --git a/src/command.ts b/src/command.ts index 7b08b17..89b08b9 100644 --- a/src/command.ts +++ b/src/command.ts @@ -18,13 +18,13 @@ export const Commands = [ "shorten", "subscribe", ] as const; -export type CommandName = typeof Commands[number]; -function getCommandName(name: string) : CommandName | undefined { - for (const command of Commands) { - if (command === name) { - return command; - } +export type CommandName = (typeof Commands)[number]; +function getCommandName(name: string): CommandName | undefined { + for (const command of Commands) { + if (command === name) { + return command; } + } } export class Command { @@ -35,7 +35,7 @@ export class Command { if (this.cache[name] !== undefined) { return this.cache[name]; } - if (this.config.ServerId){ + if (this.config.ServerId) { const command = await this.getCommand(name); this.cache[name] = command; return command; @@ -58,7 +58,7 @@ export class Command { if (data?.application_commands) { data.application_commands.forEach((command: any) => { const name = getCommandName(command.name); - if(name){ + if (name) { this.cache[name] = command; } }); diff --git a/src/index.ts b/src/index.ts index 58f5f6b..a5f57f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,3 +5,4 @@ export * from "./interfaces/index"; export * from "./midjourne.api"; export * from "./command"; export * from "./verify.human"; +export * from "./banned.words";