aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2022-05-03 13:57:09 -0400
committerCara Salter <cara@devcara.com>2022-05-03 13:57:09 -0400
commit5999e6a803a7b848acf054918fec9ee5024d5697 (patch)
treeeae1f3986c41f7d7c1a956e4606a8120c6032e05 /src/main.rs
parent8f4277c55a2079edf1c9a69383c353e1cb9ef55c (diff)
downloadglitch-ng-5999e6a803a7b848acf054918fec9ee5024d5697.tar.gz
glitch-ng-5999e6a803a7b848acf054918fec9ee5024d5697.zip
filter: Initial message filter implementation
Also a custom error type, tracing_subscriber, and unsafe impls
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 88d612e..38a849b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,4 @@
-#![forbid(missing_docs)]
+#![deny(missing_docs)]
/*!
* Full rewrite of the [Glitch](https://glitchbot.net) bot in Poise with slash commands
*
@@ -17,6 +17,7 @@ type Context<'a> = poise::Context<'a, Data, Error>;
mod commands;
mod handler;
mod models;
+mod errors;
/// Contains data shared between all commands
pub struct Data {
@@ -70,6 +71,7 @@ async fn register(ctx: Context<'_>, #[flag] global: bool) -> Result<(), Error> {
async fn main() {
// Initialize environment and logging
dotenv().unwrap();
+ color_eyre::install().unwrap();
tracing_subscriber::fmt::init();
info!("Initialized logging");
let options = poise::FrameworkOptions {
@@ -94,6 +96,13 @@ async fn main() {
],
..commands::reactionroles::rroles()
},
+ poise::Command {
+ subcommands: vec![
+ commands::filters::list(),
+ commands::filters::add(),
+ ],
+ ..commands::filters::filter()
+ },
],
// This requires a closure, for some reason
on_error: |error| Box::pin(on_error(error)),