#[event]
Expand description
Registers the annotated Event
upon the
given #[butler_plugin]
being built.
§Usage
§On a struct
#[derive(Event)]
#[event(plugin = MyPlugin)]
struct MessageReceived(String);
§On an imported type
#[event(plugin = MyPlugin)]
use my_mod::ModMessageReceived;
§On a type alias
#[event(plugin = MyPlugin)]
type MyMessage = ExternalEventMessage<String>;
§Arguments
§plugin
(Required)
A Plugin
annotated with #[butler_plugin]
to register this resource to.
§generics
A list of generic arguments to register the event with. Used to register a generic event for multiple different types.