Added Service files, Fixed terminal bug
This commit is contained in:
parent
06b90cb5bf
commit
f20dbe247c
2 changed files with 13 additions and 0 deletions
8
automod.service
Normal file
8
automod.service
Normal file
|
@ -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
|
|
@ -131,6 +131,8 @@ fn run_bot(mut terminal: Terminal<CrosstermBackend<&io::Stdout>>) {
|
||||||
|
|
||||||
// Enter a loop (not for debugging)
|
// Enter a loop (not for debugging)
|
||||||
loop {
|
loop {
|
||||||
|
let _ = enable_raw_mode();
|
||||||
|
let _ = execute!(terminal.backend_mut(), EnterAlternateScreen, EnableMouseCapture);
|
||||||
this.run_once(old);
|
this.run_once(old);
|
||||||
|
|
||||||
// Update UI
|
// Update UI
|
||||||
|
@ -150,6 +152,9 @@ fn run_bot(mut terminal: Terminal<CrosstermBackend<&io::Stdout>>) {
|
||||||
|
|
||||||
this.idle();
|
this.idle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ui<B: Backend>(f: &mut Frame<B>, state: &Bot) {
|
fn ui<B: Backend>(f: &mut Frame<B>, state: &Bot) {
|
||||||
|
|
Loading…
Reference in a new issue