- Added hunt/feed duck mechanics (80% hunt, 20% feed) - Implemented persistent scoring system - Added channel control commands (\!stopducks/\!startducks) - Enhanced duck hunt with wrong action penalties - Organized bot structure with botmain.js as main file - Added comprehensive documentation (README.md) - Included 17 plugins with various games and utilities 🦆 Duck Hunt Features: - Hunt ducks with \!shoot/\!bang (80% of spawns) - Feed ducks with \!feed (20% of spawns) - Persistent scores saved to JSON - Channel-specific controls for #bakedbeans - Reaction time tracking and special achievements 🎮 Other Games: - Casino games (slots, coinflip, hi-lo, scratch cards) - Multiplayer games (pigs, zombie dice, quiplash) - Text generation (babble, conspiracy, drunk historian) - Interactive features (story writing, emojify, combos) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
262 lines
No EOL
14 KiB
JavaScript
262 lines
No EOL
14 KiB
JavaScript
// plugins/emojify.js - Convert words to emojis
|
||
module.exports = {
|
||
init(bot) {
|
||
console.log('😀 Emojify plugin initialized');
|
||
|
||
// Word to emoji mappings
|
||
this.emojiMap = {
|
||
// Basic emotions & feelings
|
||
'happy': '😊', 'sad': '😢', 'angry': '😠', 'love': '❤️', 'heart': '❤️',
|
||
'laugh': '😂', 'cry': '😭', 'smile': '😊', 'mad': '😡', 'joy': '😊',
|
||
'excited': '🤗', 'nervous': '😰', 'worried': '😟', 'scared': '😨',
|
||
'surprised': '😲', 'confused': '😕', 'tired': '😴', 'sleepy': '😴',
|
||
'kiss': '😘', 'wink': '😉', 'cool': '😎', 'shocked': '😱',
|
||
'amazing': '🤩', 'awesome': '🤩', 'great': '😊', 'wonderful': '😍',
|
||
'terrible': '😭', 'awful': '😖', 'horrible': '😱', 'fantastic': '🤩',
|
||
'peaceful': '😌', 'calm': '😌', 'relaxed': '😌', 'stressed': '😰',
|
||
'disappointed': '😞', 'devastated': '💔', 'heartbroken': '💔', 'lonely': '😔',
|
||
'embarrassed': '😳', 'proud': '😤', 'confident': '😎', 'shy': '😳',
|
||
'grateful': '🙏', 'thankful': '🙏', 'blessed': '🙏', 'lucky': '🍀',
|
||
'funny': '😂', 'hilarious': '😂', 'boring': '😴', 'interesting': '🤔',
|
||
|
||
// Animals & creatures
|
||
'cat': '🐱', 'dog': '🐶', 'bird': '🐦', 'fish': '🐟', 'snake': '🐍',
|
||
'horse': '🐴', 'cow': '🐄', 'pig': '🐷', 'sheep': '🐑', 'chicken': '🐔',
|
||
'duck': '🦆', 'frog': '🐸', 'monkey': '🐵', 'elephant': '🐘', 'lion': '🦁',
|
||
'tiger': '🐯', 'bear': '🐻', 'panda': '🐼', 'koala': '🐨', 'mouse': '🐭',
|
||
'rabbit': '🐰', 'fox': '🦊', 'wolf': '🐺', 'bee': '🐝', 'butterfly': '🦋',
|
||
'spider': '🕷️', 'ant': '🐜', 'bug': '🐛', 'worm': '🪱', 'fly': '🪰',
|
||
'unicorn': '🦄', 'dragon': '🐉', 'dinosaur': '🦕', 'monster': '👹',
|
||
'pet': '🐾', 'pets': '🐾', 'animal': '🐾', 'animals': '🐾',
|
||
'puppy': '🐶', 'kitten': '🐱', 'baby': '👶', 'babies': '👶',
|
||
|
||
// Food and drinks
|
||
'pizza': '🍕', 'burger': '🍔', 'fries': '🍟', 'hotdog': '🌭', 'taco': '🌮',
|
||
'sandwich': '🥪', 'bread': '🍞', 'cheese': '🧀', 'meat': '🥩', 'chicken': '🍗',
|
||
'apple': '🍎', 'banana': '🍌', 'orange': '🍊', 'grapes': '🍇', 'strawberry': '🍓',
|
||
'cherry': '🍒', 'peach': '🍑', 'pineapple': '🍍', 'watermelon': '🍉', 'lemon': '🍋',
|
||
'coffee': '☕', 'tea': '🍵', 'beer': '🍺', 'wine': '🍷', 'water': '💧',
|
||
'milk': '🥛', 'juice': '🧃', 'cake': '🎂', 'cookie': '🍪', 'chocolate': '🍫',
|
||
'icecream': '🍦', 'donut': '🍩', 'candy': '🍬', 'food': '🍽️',
|
||
'eat': '🍽️', 'eating': '🍽️', 'meal': '🍽️', 'dinner': '🍽️',
|
||
'lunch': '🍽️', 'breakfast': '🍽️', 'snack': '🍿', 'hungry': '🍽️',
|
||
'drink': '🥤', 'drinking': '🥤', 'thirsty': '🥤', 'soda': '🥤',
|
||
'restaurant': '🍽️', 'kitchen': '🍳', 'cooking': '🍳', 'cook': '🍳',
|
||
'delicious': '😋', 'yummy': '😋', 'tasty': '😋', 'spicy': '🌶️',
|
||
'sweet': '🍯', 'sour': '🍋', 'healthy': '🥗',
|
||
|
||
// Weather & nature
|
||
'sun': '☀️', 'sunny': '☀️', 'moon': '🌙', 'star': '⭐', 'cloud': '☁️',
|
||
'cloudy': '☁️', 'rain': '🌧️', 'rainy': '🌧️', 'snow': '❄️', 'snowy': '❄️',
|
||
'storm': '⛈️', 'thunder': '⛈️', 'lightning': '⚡', 'wind': '💨', 'hot': '🔥',
|
||
'cold': '🧊', 'fire': '🔥', 'ice': '🧊', 'rainbow': '🌈',
|
||
'weather': '🌤️', 'temperature': '🌡️', 'warm': '☀️', 'freezing': '🧊',
|
||
'foggy': '🌫️', 'fog': '🌫️', 'tornado': '🌪️', 'hurricane': '🌀',
|
||
'nature': '🌿', 'forest': '🌲', 'tree': '🌳', 'flower': '🌸', 'grass': '🌱',
|
||
'plant': '🌱', 'garden': '🌻', 'leaf': '🍃', 'rose': '🌹',
|
||
'desert': '🏜️', 'mountain': '⛰️', 'ocean': '🌊', 'sea': '🌊', 'beach': '🏖️',
|
||
'sky': '☁️', 'earth': '🌍', 'world': '🌍', 'planet': '🌍',
|
||
|
||
// Transportation
|
||
'car': '🚗', 'bus': '🚌', 'train': '🚂', 'plane': '✈️', 'ship': '🚢',
|
||
'bike': '🚴', 'bicycle': '🚴', 'motorcycle': '🏍️', 'truck': '🚚', 'taxi': '🚕',
|
||
'rocket': '🚀', 'helicopter': '🚁', 'boat': '⛵',
|
||
'drive': '🚗', 'driving': '🚗', 'fly': '✈️', 'flying': '✈️',
|
||
'ride': '🚗', 'travel': '🧳', 'trip': '🧳', 'vacation': '🏖️',
|
||
'road': '🛣️', 'traffic': '🚦', 'airport': '✈️',
|
||
|
||
// Technology
|
||
'computer': '💻', 'phone': '📱', 'tv': '📺', 'camera': '📷', 'game': '🎮',
|
||
'internet': '🌐', 'email': '📧', 'message': '💬', 'robot': '🤖', 'battery': '🔋',
|
||
'wifi': '📶', 'code': '💻', 'coding': '💻', 'programming': '💻',
|
||
'technology': '💻', 'tech': '💻', 'digital': '💻', 'online': '🌐',
|
||
'website': '🌐', 'software': '💻', 'app': '📱', 'video': '📹',
|
||
'photo': '📷', 'picture': '📷', 'screen': '📺', 'laptop': '💻',
|
||
'headphones': '🎧', 'data': '💾', 'password': '🔒',
|
||
|
||
// Activities
|
||
'work': '💼', 'school': '🏫', 'study': '📚', 'read': '📖', 'write': '✍️',
|
||
'music': '🎵', 'dance': '💃', 'sing': '🎤', 'play': '🎮', 'sport': '⚽',
|
||
'football': '🏈', 'soccer': '⚽', 'basketball': '🏀', 'tennis': '🎾',
|
||
'swim': '🏊', 'run': '🏃', 'walk': '🚶', 'exercise': '💪', 'gym': '🏋️',
|
||
'sleep': '😴', 'dream': '💭', 'party': '🎉', 'celebrate': '🎉',
|
||
'job': '💼', 'office': '🏢', 'meeting': '👥', 'learn': '📚',
|
||
'homework': '📝', 'test': '📝', 'hobby': '🎨', 'fun': '🎉',
|
||
'movie': '🎬', 'film': '🎬', 'show': '📺', 'art': '🎨',
|
||
'paint': '🎨', 'draw': '✏️', 'shopping': '🛒', 'shop': '🏪',
|
||
'buy': '💰', 'cook': '🍳', 'clean': '🧹', 'relax': '😌',
|
||
|
||
// Objects
|
||
'house': '🏠', 'home': '🏠', 'building': '🏢', 'book': '📚',
|
||
'pen': '✏️', 'pencil': '✏️', 'paper': '📄', 'money': '💰',
|
||
'gift': '🎁', 'present': '🎁', 'key': '🔑', 'door': '🚪',
|
||
'clock': '🕐', 'time': '⏰', 'watch': '⌚', 'glasses': '👓',
|
||
'hat': '👒', 'shirt': '👕', 'shoes': '👟', 'bag': '👜',
|
||
'chair': '🪑', 'table': '🪑', 'bed': '🛏️', 'lamp': '💡',
|
||
'light': '💡', 'mirror': '🪞', 'tool': '🔧', 'hammer': '🔨',
|
||
'box': '📦', 'bottle': '🍼', 'cup': '☕', 'plate': '🍽️',
|
||
|
||
// Colors
|
||
'red': '🔴', 'blue': '🔵', 'green': '🟢', 'yellow': '🟡', 'orange': '🟠',
|
||
'purple': '🟣', 'black': '⚫', 'white': '⚪', 'pink': '🩷', 'brown': '🤎',
|
||
'color': '🌈', 'bright': '✨', 'dark': '⚫',
|
||
|
||
// Numbers
|
||
'one': '1️⃣', 'two': '2️⃣', 'three': '3️⃣', 'four': '4️⃣', 'five': '5️⃣',
|
||
'six': '6️⃣', 'seven': '7️⃣', 'eight': '8️⃣', 'nine': '9️⃣', 'ten': '🔟',
|
||
'1': '1️⃣', '2': '2️⃣', '3': '3️⃣', '4': '4️⃣', '5': '5️⃣',
|
||
'6': '6️⃣', '7': '7️⃣', '8': '8️⃣', '9': '9️⃣', '10': '🔟',
|
||
'first': '1️⃣', 'second': '2️⃣', 'third': '3️⃣',
|
||
|
||
// Directions
|
||
'up': '⬆️', 'down': '⬇️', 'left': '⬅️', 'right': '➡️',
|
||
'north': '⬆️', 'south': '⬇️', 'east': '➡️', 'west': '⬅️',
|
||
'here': '📍', 'there': '👉',
|
||
|
||
// Actions
|
||
'stop': '🛑', 'go': '✅', 'yes': '✅', 'no': '❌', 'ok': '👌',
|
||
'good': '👍', 'bad': '👎', 'like': '👍', 'help': '🆘',
|
||
'start': '▶️', 'end': '⏹️', 'open': '🔓', 'close': '🔒',
|
||
'give': '🤲', 'take': '✋', 'throw': '🤾', 'jump': '🦘',
|
||
'win': '🏆', 'lose': '😞', 'try': '💪', 'talk': '💬',
|
||
'listen': '👂', 'see': '👁️', 'look': '👁️', 'watch': '👁️',
|
||
|
||
// Symbols
|
||
'question': '❓', 'idea': '💡', 'magic': '✨', 'star': '⭐',
|
||
'diamond': '💎', 'crown': '👑', 'trophy': '🏆', 'flag': '🏳️',
|
||
'peace': '☮️', 'power': '💪', 'energy': '⚡', 'speed': '💨',
|
||
'big': '🔵', 'small': '🔸', 'fast': '💨', 'slow': '🐌',
|
||
|
||
// Places
|
||
'city': '🏙️', 'park': '🏞️', 'hospital': '🏥', 'bank': '🏦',
|
||
'church': '⛪', 'library': '📚', 'cafe': '☕', 'hotel': '🏨',
|
||
|
||
// Body parts
|
||
'face': '😊', 'eye': '👁️', 'nose': '👃', 'hand': '✋',
|
||
'finger': '👆', 'hair': '💇', 'teeth': '🦷', 'brain': '🧠',
|
||
|
||
// Time
|
||
'morning': '🌅', 'afternoon': '☀️', 'evening': '🌇', 'night': '🌙',
|
||
'today': '📅', 'tomorrow': '📅', 'birthday': '🎂'
|
||
};
|
||
|
||
// Common words that should sometimes be replaced with contextual emojis
|
||
this.contextualMap = {
|
||
'and': '➕', 'with': '🤝', 'very': '⭐', 'really': '⭐',
|
||
'maybe': '🤔', 'definitely': '✅', 'finally': '🎉',
|
||
'quickly': '💨', 'slowly': '🐌', 'never': '❌', 'always': '♾️',
|
||
'everywhere': '🌍', 'everyone': '👥', 'everything': '🌍'
|
||
};
|
||
},
|
||
|
||
cleanup(bot) {
|
||
console.log('😀 Emojify plugin cleaned up');
|
||
},
|
||
|
||
emojifyText(text) {
|
||
if (!text || text.trim().length === 0) {
|
||
return 'Please provide a message to emojify! 😊';
|
||
}
|
||
|
||
// Split into words and process each one
|
||
const words = text.toLowerCase().split(/\s+/);
|
||
const result = [];
|
||
|
||
for (let word of words) {
|
||
// Remove punctuation for matching but keep it for display
|
||
const cleanWord = word.replace(/[^\w]/g, '');
|
||
const punctuation = word.replace(/[\w]/g, '');
|
||
|
||
// Check for direct emoji match
|
||
if (this.emojiMap[cleanWord]) {
|
||
result.push(this.emojiMap[cleanWord] + punctuation);
|
||
}
|
||
// Check for contextual matches (use sparingly)
|
||
else if (this.contextualMap[cleanWord] && Math.random() < 0.3) {
|
||
result.push(this.contextualMap[cleanWord] + punctuation);
|
||
}
|
||
// Check for partial matches (plurals, etc.)
|
||
else {
|
||
let found = false;
|
||
|
||
// Try removing common suffixes
|
||
const suffixes = ['s', 'es', 'ed', 'ing', 'ly', 'er', 'est'];
|
||
for (const suffix of suffixes) {
|
||
if (cleanWord.endsWith(suffix)) {
|
||
const root = cleanWord.slice(0, -suffix.length);
|
||
if (this.emojiMap[root]) {
|
||
result.push(this.emojiMap[root] + punctuation);
|
||
found = true;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
// If no match found, keep original word
|
||
if (!found) {
|
||
result.push(word);
|
||
}
|
||
}
|
||
}
|
||
|
||
return result.join(' ');
|
||
},
|
||
|
||
commands: [
|
||
{
|
||
name: 'emojify',
|
||
description: 'Convert words in a message to emojis',
|
||
execute: function(context, bot) {
|
||
const plugin = module.exports;
|
||
const target = context.replyTo;
|
||
const from = context.nick;
|
||
const args = context.args;
|
||
|
||
if (args.length === 0) {
|
||
bot.say(target, `${from}: Usage: !emojify <message>`);
|
||
return;
|
||
}
|
||
|
||
const message = args.join(' ');
|
||
const emojified = plugin.emojifyText(message);
|
||
|
||
bot.say(target, `😀 ${emojified}`);
|
||
}
|
||
},
|
||
|
||
{
|
||
name: 'emojihelp',
|
||
description: 'Show some example words that can be emojified',
|
||
execute: function(context, bot) {
|
||
const plugin = module.exports;
|
||
const target = context.replyTo;
|
||
|
||
const examples = [
|
||
'happy sad angry love', 'cat dog bird fish',
|
||
'pizza coffee beer cake', 'sun rain snow fire',
|
||
'car plane train bike', 'work sleep party dance'
|
||
];
|
||
|
||
const randomExample = examples[Math.floor(Math.random() * examples.length)];
|
||
const emojified = plugin.emojifyText(randomExample);
|
||
|
||
bot.say(target, `📝 Example: "${randomExample}" becomes "${emojified}"`);
|
||
bot.say(target, `💡 Try words like: animals, food, weather, emotions, activities, colors, numbers!`);
|
||
}
|
||
},
|
||
|
||
{
|
||
name: 'emojicount',
|
||
description: 'Show how many words can be emojified',
|
||
execute: function(context, bot) {
|
||
const plugin = module.exports;
|
||
const target = context.replyTo;
|
||
|
||
const totalWords = Object.keys(plugin.emojiMap).length;
|
||
const contextualWords = Object.keys(plugin.contextualMap).length;
|
||
|
||
bot.say(target, `📊 I know ${totalWords} emoji replacements + ${contextualWords} contextual ones = ${totalWords + contextualWords} total!`);
|
||
}
|
||
}
|
||
]
|
||
}; |