summary refs log tree commit diff
path: root/src/system/plugin.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/system/plugin.rs')
-rw-r--r--src/system/plugin.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/system/plugin.rs b/src/system/plugin.rs
new file mode 100644
index 0000000..c458fd4
--- /dev/null
+++ b/src/system/plugin.rs
@@ -0,0 +1,25 @@
+mod autoproxy;
+mod prefixes;
+
+use async_trait::async_trait;
+
+use twilight_model::{channel::{Channel, Message}, id::{marker::ChannelMarker, Id}};
+use crate::system::types::{System, Response};
+
+pub use prefixes::ProxyPrefixes;
+pub use autoproxy::Autoproxy;
+
+#[async_trait]
+pub trait SeancePlugin {
+    async fn handle_command(&self, system: &System, message: &Message) -> CommandOutcome;
+
+    async fn handle_message(&self, system: &System, message: &Message, response: &mut Response);
+
+    async fn post_response(&self, system: &System, message: &Message, channel: Id<ChannelMarker>, response: &Response);
+}
+
+pub enum CommandOutcome {
+    Skipped,
+    Handled,
+    Errored {message: String},
+}