reorg botactions.rs
This commit is contained in:
parent
c0e6bcc566
commit
616d1f564f
6 changed files with 31 additions and 13 deletions
|
@ -1,18 +1,31 @@
|
||||||
|
|
||||||
|
use twitch_irc::message::PrivmsgMessage;
|
||||||
|
use std::sync::Arc;
|
||||||
|
// use tokio::sync::{Mutex, RwLock};
|
||||||
|
use tokio::sync::RwLock;
|
||||||
|
|
||||||
|
use crate::core::botinstance::BotInstance;
|
||||||
|
|
||||||
|
|
||||||
|
pub type BotAR = Arc<RwLock<BotInstance>>;
|
||||||
|
|
||||||
|
|
||||||
|
pub struct ExecBodyParams {
|
||||||
|
bot : BotAR,
|
||||||
|
msg : PrivmsgMessage,
|
||||||
|
// parent_act : BotAction ,
|
||||||
|
}
|
||||||
|
|
||||||
pub mod actions_util {
|
pub mod actions_util {
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
use std::boxed::Box;
|
use std::boxed::Box;
|
||||||
use std::future::Future;
|
use std::future::Future;
|
||||||
use std::pin::Pin;
|
use std::pin::Pin;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
use tokio::sync::{Mutex, RwLock};
|
|
||||||
|
|
||||||
use twitch_irc::message::PrivmsgMessage;
|
// pub type BotAM = Arc<Mutex<BotInstance>>;
|
||||||
|
|
||||||
use crate::core::botinstance::BotInstance;
|
|
||||||
|
|
||||||
pub type BotAM = Arc<Mutex<BotInstance>>;
|
|
||||||
pub type BotAR = Arc<RwLock<BotInstance>>;
|
|
||||||
|
|
||||||
pub type ExecBody = Box<
|
pub type ExecBody = Box<
|
||||||
dyn Fn(BotAR, PrivmsgMessage) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync,
|
dyn Fn(BotAR, PrivmsgMessage) -> Pin<Box<dyn Future<Output = ()> + Send>> + Send + Sync,
|
||||||
|
|
|
@ -17,7 +17,8 @@ use casual_logger::Log;
|
||||||
|
|
||||||
use crate::core::ratelimiter::RateLimiter;
|
use crate::core::ratelimiter::RateLimiter;
|
||||||
|
|
||||||
use crate::core::bot_actions::actions_util::BotAR;
|
// use crate::core::bot_actions::actions_util::BotAR;
|
||||||
|
use crate::core::bot_actions::BotAR;
|
||||||
use crate::core::botmodules::ModulesManager;
|
use crate::core::botmodules::ModulesManager;
|
||||||
use crate::core::identity::{IdentityManager, Permissible,self};
|
use crate::core::identity::{IdentityManager, Permissible,self};
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ use tokio::sync::RwLock;
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
|
||||||
use self::bot_actions::actions_util::BotAR;
|
// use self::bot_actions::actions_util::BotAR;
|
||||||
|
use crate::core::bot_actions::BotAR;
|
||||||
use crate::core::bot_actions::actions_util;
|
use crate::core::bot_actions::actions_util;
|
||||||
use crate::core::botinstance::{BotInstance, Channel,ChangeResult};
|
use crate::core::botinstance::{BotInstance, Channel,ChangeResult};
|
||||||
use crate::core::botlog;
|
use crate::core::botlog;
|
||||||
|
|
|
@ -7,7 +7,8 @@ use twitch_irc::message::PrivmsgMessage;
|
||||||
|
|
||||||
use casual_logger::Log;
|
use casual_logger::Log;
|
||||||
|
|
||||||
use crate::core::bot_actions::actions_util::{self, BotAR};
|
use crate::core::bot_actions::actions_util;
|
||||||
|
use crate::core::bot_actions::BotAR;
|
||||||
use crate::core::botinstance::{Channel,ChangeResult};
|
use crate::core::botinstance::{Channel,ChangeResult};
|
||||||
use crate::core::botlog;
|
use crate::core::botlog;
|
||||||
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
|
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
|
||||||
|
|
|
@ -19,7 +19,8 @@ use twitch_irc::message::PrivmsgMessage;
|
||||||
use crate::core::botinstance::Channel;
|
use crate::core::botinstance::Channel;
|
||||||
use crate::core::botlog;
|
use crate::core::botlog;
|
||||||
|
|
||||||
use crate::core::bot_actions::actions_util::{self, BotAR};
|
use crate::core::bot_actions::actions_util;
|
||||||
|
use crate::core::bot_actions::BotAR;
|
||||||
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager};
|
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager};
|
||||||
|
|
||||||
use crate::core::identity::UserRole::*;
|
use crate::core::identity::UserRole::*;
|
||||||
|
|
|
@ -24,7 +24,8 @@ use crate::core::botlog;
|
||||||
|
|
||||||
use casual_logger::Log;
|
use casual_logger::Log;
|
||||||
|
|
||||||
use crate::core::bot_actions::actions_util::{self, BotAR};
|
use crate::core::bot_actions::actions_util;
|
||||||
|
use crate::core::bot_actions::BotAR;
|
||||||
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
|
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, ModulesManager};
|
||||||
|
|
||||||
use crate::core::identity::UserRole::*;
|
use crate::core::identity::UserRole::*;
|
||||||
|
|
Loading…
Reference in a new issue