From f20dbe247c29b476248f77a0bde27b7158f41f6d Mon Sep 17 00:00:00 2001 From: Neshura Date: Mon, 3 Jul 2023 19:22:02 +0200 Subject: [PATCH] Added Service files, Fixed terminal bug --- automod.service | 8 ++++++++ src/main.rs | 5 +++++ 2 files changed, 13 insertions(+) create mode 100644 automod.service diff --git a/automod.service b/automod.service new file mode 100644 index 0000000..13e6903 --- /dev/null +++ b/automod.service @@ -0,0 +1,8 @@ +[Unit] +Description="Automod for bookwormstory.social" + +[Service] +User=server +WorkingDirectory=/home/server +ExecStart=/usr/bin/screen -dmS automod /home/server/automod +Type=forking \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index f8d0297..3296574 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,6 +131,8 @@ fn run_bot(mut terminal: Terminal>) { // Enter a loop (not for debugging) loop { + let _ = enable_raw_mode(); + let _ = execute!(terminal.backend_mut(), EnterAlternateScreen, EnableMouseCapture); this.run_once(old); // Update UI @@ -150,6 +152,9 @@ fn run_bot(mut terminal: Terminal>) { this.idle(); } + + + } fn ui(f: &mut Frame, state: &Bot) {