Remove unnecessary server config
This commit is contained in:
parent
c71b2dbf22
commit
dac2fb06d3
1 changed files with 2 additions and 11 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use std::{fmt::Debug, sync::Arc};
|
||||
|
||||
use euphoxide_client::{MultiClient, MultiClientConfig, MultiClientEvent, ServerConfig};
|
||||
use euphoxide_client::{MultiClient, MultiClientConfig, MultiClientEvent};
|
||||
use log::error;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
|
|
@ -8,31 +8,23 @@ use crate::command::Commands;
|
|||
|
||||
#[non_exhaustive]
|
||||
pub struct Bot<E = euphoxide::Error> {
|
||||
pub server_config: ServerConfig,
|
||||
pub commands: Arc<Commands<E>>,
|
||||
pub clients: MultiClient,
|
||||
}
|
||||
|
||||
impl Bot {
|
||||
pub fn new_simple(commands: Commands, event_tx: mpsc::Sender<MultiClientEvent>) -> Self {
|
||||
Self::new(
|
||||
ServerConfig::default(),
|
||||
MultiClientConfig::default(),
|
||||
commands,
|
||||
event_tx,
|
||||
)
|
||||
Self::new(MultiClientConfig::default(), commands, event_tx)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E> Bot<E> {
|
||||
pub fn new(
|
||||
server_config: ServerConfig,
|
||||
clients_config: MultiClientConfig,
|
||||
commands: Commands<E>,
|
||||
event_tx: mpsc::Sender<MultiClientEvent>,
|
||||
) -> Self {
|
||||
Self {
|
||||
server_config,
|
||||
commands: Arc::new(commands),
|
||||
clients: MultiClient::new_with_config(clients_config, event_tx),
|
||||
}
|
||||
|
|
@ -56,7 +48,6 @@ where
|
|||
impl<E> Clone for Bot<E> {
|
||||
fn clone(&self) -> Self {
|
||||
Self {
|
||||
server_config: self.server_config.clone(),
|
||||
commands: self.commands.clone(),
|
||||
clients: self.clients.clone(),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue