Split up instance config

This commit is contained in:
Joscha 2023-01-22 19:07:23 +01:00
parent adcd17deae
commit 5a8ad6b40f
2 changed files with 99 additions and 56 deletions

View file

@ -3,7 +3,7 @@
use euphoxide::api::packet::ParsedPacket;
use euphoxide::api::{Data, Nick, Send};
use euphoxide::bot::instance::{Config, Snapshot};
use euphoxide::bot::instance::{ServerConfig, Snapshot};
use time::OffsetDateTime;
use tokio::sync::mpsc;
@ -153,7 +153,8 @@ async fn on_packet(packet: ParsedPacket, snapshot: Snapshot) -> Result<(), ()> {
async fn main() {
let (tx, mut rx) = mpsc::unbounded_channel();
let _instance = Config::new("test")
let _instance = ServerConfig::default()
.room("test")
.username(Some("TestBot"))
.build(move |e| {
let _ = tx.send(e);