summary refs log tree commit diff
path: root/src/system/plugin.rs
diff options
context:
space:
mode:
authorAshelyn Rose <git@ashen.earth>2025-02-28 21:52:16 -0700
committerAshelyn Rose <git@ashen.earth>2025-02-28 21:52:16 -0700
commite9253bd959bf5bf6e8bcc6de4db247895b015a16 (patch)
tree1817aed80c8255d1292007a81e7f0a16138d25cc /src/system/plugin.rs
parent5cb49a76c2cedb500b82f405af3cf1dcc0507f98 (diff)
Partial refactor
Handles message prefixes and autoproxy
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},
+}