Enum dazeus::Request
[−]
[src]
pub enum Request { Subscribe(EventType), Unsubscribe(EventType), SubscribeCommand(Command, Option<Network>), Networks, Channels(Network), Message(Network, Target, Message), Notice(Network, Target, Message), Ctcp(Network, Target, Message), CtcpReply(Network, Target, Message), Action(Network, Target, Message), Names(Network, Target), Whois(Network, Target), Join(Network, Target), Part(Network, Target), Nick(Network), Handshake(PluginName, PluginVersion, Option<String>), Config(String, ConfigGroup), GetProperty(String, Scope), SetProperty(String, String, Scope), UnsetProperty(String, Scope), PropertyKeys(String, Scope), SetPermission(String, bool, Scope), HasPermission(String, bool, Scope), UnsetPermission(String, Scope), }
An enum of all requests that can be sent to your DaZeus instance.
Note that typically you won't create these request instances directly. Instead you can use the
different DaZeus
methods. However if you wish, you can directly use DaZeus::send()
to send
these requests yourself.
Variants
Subscribe | |
Unsubscribe | Unsubscribe from an event. Note that you cannot specify ExampleRequest::Unsubscribe(EventType::Join) |
SubscribeCommand | Subscribe to a command (optionally on a specific network). You can use ExampleRequest::SubscribeCommand("greet".to_string(), Some("freenode".to_string())) |
Networks | Retrieve a list of networks that the DaZeus core is currently connected to. ExampleRequest::Networks |
Channels | Retrieve a list of channels on the specified network that the bot has joined. ExampleRequest::Channels("freenode".to_string()) |
Message | Request to send a message to a specific target on some network. This will request DaZeus to send a PRIVMSG. ExampleRequest::Message("freenode".to_string(), "#botters-test".to_string(), "Hello!".to_string()) |
Notice | Request to send a notice to some target on some network. This will request DaZeus to send a NOTICE. ExampleRequest::Notice("example".to_string(), "MrExample".to_string(), "Message!".to_string()) |
Ctcp | Request to send a CTCP message to some client on some network. ExampleRequest::Ctcp("example".to_string(), "MrExample".to_string(), "VERSION".to_string()) |
CtcpReply | Request to send a CTCP message reply to some client on some network. ExampleRequest::CtcpReply("example".to_string(), "MrExample".to_string(), "VERSION DaZeus 2.0".to_string()) |
Action | Request to send a CTCP ACTION message to some target on some network. A CTCP ACTION is most known by users as the ExampleRequest::Action("example".to_string(), "#example", "is creating an example".to_string()) |
Names | Request to send the list of names in some channel. Note that such a request will generate an ExampleRequest::Names("freenode".to_string(), "#freenode".to_string()) |
Whois | Request to send a whois on some target. Note that such a request will generate an ExampleRequest::Whois("example".to_string(), "MrExample".to_string()) |
Join | Request to join a channel on some network. ExampleRequest::Join("freenode".to_string(), "#freenode".to_string()) |
Part | Request to leave a channel on some network. ExampleRequest::Part("freenode".to_string(), "#freenode".to_string()) |
Nick | |
Handshake | Request for a handshake to the DaZeus Core. The handshake allows the plugin to retrieve configuration options. The second parameter of this request variant is the plugin version. Note that this parameter should be equal to the version that these bindings understand. The optional third parameter may provide an alternative name to be used to retrieve options from the DaZeus core config. By default the name of the plugin will be used. ExampleRequest::Handshake("my_plugin".to_string(), PROTOCOL_VERSION.to_string(), None) |
Config | Retrieve some option from the DaZeus core config. The second parameter is the section from which the configuration parameter should be
retrieved. This may either be Note that in order to successfully retrieve these configuration values the plugin first needs to have completed a succesful handshake with the core. ExampleRequest::Config("highlight".to_string(), ConfigGroup::Core) |
GetProperty | Retrieve a property from the internal DaZeus core database. ExampleRequest::GetProperty("example".to_string(), Scope::any()) |
SetProperty | Set a property in the internal DaZeus core database. ExampleRequest::SetProperty("example".to_string(), "value".to_string(), Scope::any()) |
UnsetProperty | Remove a property from the internal DaZeus core database. ExampleRequest::UnsetProperty("example".to_string(), Scope::any()) |
PropertyKeys | Retrieve a set of keys that is available for some prefix and scope. The first parameter of the variant is the prefix string for retrieving property keys. ExampleRequest::PropertyKeys("path.to".to_string(), Scope::network("example")) |
SetPermission | Set a permission in the permission database of the DaZeus core. ExampleRequest::SetPermission("edit".to_string(), true, Scope::sender("example", "MrExample")) |
HasPermission | Request a permission to be retrieved from the permission database of the DaZeus core. The second parameter of this variant indicates the default value that the core should return if the permission was not found inside the permission database. ExampleRequest::HasPermission("edit".to_string(), false, Scope::sender("example", "MrExample")) |
UnsetPermission | Remove a permission from the permission database of the DaZeus core. ExampleRequest::UnsetPermission("edit".to_string(), Scope::sender("example", "MrExample")) |
Trait Implementations
impl ToJson for Request
Implements transforming the request to a Json object that is ready to be sent a DaZeus core.