mirror of
https://github.com/MeexReay/bRAC.git
synced 2025-05-06 13:38:04 +03:00
spam command
This commit is contained in:
parent
5a83ec57c2
commit
b2f11ca60a
10
src/main.rs
10
src/main.rs
@ -180,8 +180,14 @@ fn format_message(message: String) -> Option<String> {
|
||||
}
|
||||
|
||||
fn on_command(host: &str, command: &str) -> Result<(), Box<dyn Error>> {
|
||||
if command == "/clear" {
|
||||
send_message(host, &"\n".repeat(MAX_MESSAGES))?;
|
||||
let command = command.trim_start_matches("/");
|
||||
let (command, args) = command.split_once(" ").unwrap_or((&command, ""));
|
||||
let args = args.split(" ").collect::<Vec<&str>>();
|
||||
|
||||
if command == "clear" {
|
||||
send_message(host, &format!("\r\x1B[1A{}", " ".repeat(64)).repeat(MAX_MESSAGES))?;
|
||||
} else if command == "spam" {
|
||||
send_message(host, &format!("\r\x1B[1A{}{}", args.join(" "), " ".repeat(10)).repeat(MAX_MESSAGES))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user