megabot/plugins/emojify_plugin(2).js
megaproxy a3ed25f8dd Initial commit: Enhanced IRC bot with duck hunt game
- 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>
2025-07-17 19:03:45 +00:00

262 lines
No EOL
14 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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!`);
}
}
]
};