From b561d24c6533c0d6debc4dec1e1657fe88d7ad96 Mon Sep 17 00:00:00 2001 From: haruyuumei Date: Tue, 2 Apr 2024 22:05:30 -0300 Subject: [PATCH] Fixed Custom giving error --- src/custom.rs | 8 +++++--- src/custom/text_mods.rs | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/custom.rs b/src/custom.rs index 6107797..01fde56 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -13,6 +13,7 @@ pub use crate::core::botmodules::ModulesManager; // mod experiments; mod experimental; +mod text_mods; // [ ] init() function that accepts bot instance - this is passed to init() on submodules @@ -20,6 +21,7 @@ pub async fn init(mgr: Arc) { // Modules initializer loads modules into the bot // this is achieved by calling submodules that also have fn init() defined - // experiments::init(mgr).await - experimental::init(mgr).await; -} + experimental::init(mgr.clone()).await; + text_mods::init(Arc::clone(&mgr)).await; + +} \ No newline at end of file diff --git a/src/custom/text_mods.rs b/src/custom/text_mods.rs index 50ff131..97d060c 100644 --- a/src/custom/text_mods.rs +++ b/src/custom/text_mods.rs @@ -3,12 +3,12 @@ use std::sync::Arc; use crate::core::{bot_actions::*, botlog}; use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager}; use crate::core::identity::UserRole::*; -use rand::{thread_rng, Rng}; +//use rand::{thread_rng, Rng}; use tokio::time::{sleep, Duration}; -pub async fn init(mgr: &Arc) { +pub async fn init(mgr: Arc) { // Example Working BotCommand Add BotCommand {