megabot/plugin_template.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

37 lines
No EOL
1.2 KiB
JavaScript

// plugins/template.js - Template for creating new plugins
module.exports = {
// Called when plugin is loaded
init(bot) {
console.log('Template plugin initialized');
// You can store references, setup timers, etc.
this.bot = bot;
},
// Called when plugin is unloaded/reloaded
cleanup(bot) {
console.log('Template plugin cleaned up');
// Clean up timers, connections, etc.
},
// Event handlers (optional)
onMessage(data, bot) {
// Called for every message
// data contains: nick, user, host, target, message, isChannel, replyTo
// Uncomment and use parameters as needed:
// console.log(`Message from ${data.nick}: ${data.message}`);
},
// Commands array
commands: [
{
name: 'example',
description: 'An example command',
execute(context, bot) {
// context contains: nick, user, host, channel, replyTo, args, fullMessage
// bot is the IRCBot instance with methods like say(), action(), notice()
bot.say(context.replyTo, `Hello ${context.nick}!`);
}
}
]
};