Skip to content

Instantly share code, notes, and snippets.

@VillainsRule
Created June 14, 2024 12:07
Show Gist options
  • Save VillainsRule/c7366c51d6a9788de4c3ee66c1f3b87c to your computer and use it in GitHub Desktop.
Save VillainsRule/c7366c51d6a9788de4c3ee66c1f3b87c to your computer and use it in GitHub Desktop.
blacket guess the blook automator!
let lowerCaseBlooks = {};
Object.keys(blacket.blooks).forEach((blook) => {
lowerCaseBlooks[blook.toLowerCase()] = blacket.blooks[blook];
});
blacket.socket.on('messages-create', (m) => {
let content = m.data.message.content;
if (content.match(/\[([^\]]+)\]/g)) {
let match = content.replace(/\[([^\]]+)\]/g, (match, blook) => {
if (!m.data.author.permissions.includes("use_blook_emojis")) return;
if (!lowerCaseBlooks[blook.toLowerCase()]) return;
return setTimeout(() => blacket.sendMessage(0, blook.toLowerCase()), 500);
});
};
});
@sham6573
Copy link

🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment