summary refs log tree commit diff
path: root/src/system/plugin/prefixes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/system/plugin/prefixes.rs')
-rw-r--r--src/system/plugin/prefixes.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/system/plugin/prefixes.rs b/src/system/plugin/prefixes.rs
index 609dafd..42d8631 100644
--- a/src/system/plugin/prefixes.rs
+++ b/src/system/plugin/prefixes.rs
@@ -1,18 +1,23 @@
 use async_trait::async_trait;
 use twilight_model::id::{marker::ChannelMarker, Id};
-use crate::system::{log::Logger, types::Response};
+use twilight_model::channel::Message;
+use crate::system::{log::Logger, types::{Response, System}};
 
-use super::{CommandOutcome, SeancePlugin};
+use super::SeancePlugin;
 
 pub struct ProxyPrefixes;
 
 #[async_trait]
-impl SeancePlugin for ProxyPrefixes {
-    async fn handle_command(&self, _logger: &Logger, _system: &crate::system::types::System, _message: &twilight_model::channel::Message) -> CommandOutcome {
-        CommandOutcome::Skipped
+impl<'system> SeancePlugin<'system> for ProxyPrefixes {
+    fn get_commands(&self) -> Vec<&'static str> {
+        vec![]
     }
 
-    async fn handle_message(&self, logger: &Logger, system: &crate::system::types::System, message: &twilight_model::channel::Message, response: &mut crate::system::types::Response) {
+    async fn handle_command<'message>(&self, _logger: &'system Logger, _system: &'system System, _message: &'message Message, args: Vec<&'message str>) {
+        unreachable!("Prefix plugin has no commands")
+    }
+
+    async fn handle_message<'message>(&self, logger: &'system Logger, system: &'system System, message: &'message Message, response: &'message mut Response) {
         if let Response::Noop { delete_source: _ } = response {
             for member in &system.members {
                 match member.message_pattern.captures(message.content.as_str()) {
@@ -30,7 +35,7 @@ impl SeancePlugin for ProxyPrefixes {
         }
     }
 
-    async fn post_response(&self, _logger: &Logger, _system: &crate::system::types::System, _message: &twilight_model::channel::Message, _channel: Id<ChannelMarker>, _response: &crate::system::types::Response) {
+    async fn post_response<'message>(&self, _logger: &'system Logger, _system: &'system System, _message: &'message Message, _channel: Id<ChannelMarker>, _response: &'message Response) {
         return
     }
 }