Skip to content

duelsplus/plugin-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img

npm version License

Official Plugin API for the Duels+ Proxy. Use this package to build plugins that run inside the proxy.

Installation

npm install @duelsplus/plugin-api
# or
bun add @duelsplus/plugin-api

Quick Start

import { Plugin, PluginContext } from '@duelsplus/plugin-api';

export default class MyPlugin extends Plugin {
  id = 'my-plugin';
  name = 'My Plugin';

  onLoad(ctx: PluginContext) {
    ctx.events.on('game:start', () => {
      ctx.client.sendChat('§aGame started!');
    });
  }
}

Plugins live in ~/.duelsplus/plugins/<your-plugin>/. The proxy loads them at startup and provides the runtime; you use this package for types and the Plugin base class.

Examples

See the examples/ directory for full plugins:

Plugin Description
auto-glhf Sends a "glhf" message at game start
match-alerts Sound and title alerts for game events
opponent-tracker Tracks W/L record against each opponent
session-overlay Action bar session stats overlay
game-logger Records game history with /gamelog
lobby-spy Alerts when high-WLR opponents are in lobby

License

This project is licensed under the GNU General Public License v2.0. See LICENSE for details.