mirror of
https://github.com/SantaSpeen/Rcon-VK-Bot.git
synced 2026-02-16 02:20:45 +00:00
[+] Permission System (into bot)
[+] MultiServer System [+] (bot) perms_handler [+] (hosts) new api [+] IN_DOCKER [+] Signals handlers [+] easydict [~] Version 1.3.0 -> 2.0.0 [~] (perms) Update is_allow
This commit is contained in:
15
src/main.py
15
src/main.py
@@ -1,17 +1,22 @@
|
||||
import sys
|
||||
import platform
|
||||
import signal
|
||||
|
||||
from loguru import logger
|
||||
|
||||
from core import Bot
|
||||
from modules import enter_to_exit
|
||||
from modules import enter_to_exit, IN_DOCKER
|
||||
|
||||
if __name__ == '__main__':
|
||||
bot = Bot()
|
||||
signal.signal(signal.SIGTERM, bot.stop)
|
||||
signal.signal(signal.SIGINT, bot.stop)
|
||||
if platform.system() == 'Windows':
|
||||
signal.signal(signal.SIGBREAK, bot.stop)
|
||||
elif not IN_DOCKER:
|
||||
signal.signal(signal.SIGKILL, bot.stop)
|
||||
signal.signal(signal.SIGHUP, bot.stop)
|
||||
try:
|
||||
bot.listen()
|
||||
except KeyboardInterrupt:
|
||||
logger.info("Exited.")
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
enter_to_exit()
|
||||
|
||||
Reference in New Issue
Block a user