Made main function async
parent
ab7f75b416
commit
2af8142e54
|
@ -9,8 +9,11 @@ The bot is orientated towards admins of large Matrix rooms that are public and r
|
||||||
## How to run?
|
## How to run?
|
||||||
|
|
||||||
**Using Docker:**
|
**Using Docker:**
|
||||||
docker run -v /local/path/to/config.int:/config.ini -t matrix-modbot:latest
|
A minimal Docker image containing the compiled binary is published on [Docker Hub](https://hub.docker.com/r/davidlocalhost/matrix-modbot"). Note that this image is automatically pushed using a CI/CD Pipeline for every commit made to the main branch. Expect there to be bugs and breaking changes.
|
||||||
|
`sudo docker run -v /local/path/to/config.ini:/config.ini -t matrix-modbot:latest`
|
||||||
|
|
||||||
**Using Cargo:**
|
**Using Cargo:**
|
||||||
cargo build --release
|
```
|
||||||
cargo run
|
cargo build --release
|
||||||
|
cargo run /path/to/config.ini
|
||||||
|
```
|
||||||
|
|
|
@ -11,10 +11,13 @@ pub use utils::utils::*;
|
||||||
async fn main() {
|
async fn main() {
|
||||||
println!("Starting Matrix-Modbot");
|
println!("Starting Matrix-Modbot");
|
||||||
let mut args: Vec<String> = env::args().collect();
|
let mut args: Vec<String> = env::args().collect();
|
||||||
|
if args.len() > 1 {
|
||||||
|
panic!("Please only pass in 1 argument!");
|
||||||
|
}
|
||||||
if args.is_empty() {
|
if args.is_empty() {
|
||||||
args.push("config.ini".to_string()) // Set the default config file path to config.ini
|
args.push("config.ini".to_string()) // Set the default config file path to config.ini
|
||||||
}
|
}
|
||||||
let config_path = &args[0];
|
let config_path = &args[0];
|
||||||
let creds = BotUserInfo::get_info(config_path).unwrap();
|
let creds = BotUserInfo::get_info(config_path).unwrap();
|
||||||
Bot::bot_login(creds);
|
Bot::bot_login(creds).await;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue