mirror of
https://github.com/SantaSpeen/Rcon-VK-Bot.git
synced 2026-10-12 03:24:28 +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:
+10
-5
@@ -1,17 +1,22 @@
|
|||||||
import sys
|
import platform
|
||||||
|
import signal
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from core import Bot
|
from core import Bot
|
||||||
from modules import enter_to_exit
|
from modules import enter_to_exit, IN_DOCKER
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
bot = Bot()
|
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:
|
try:
|
||||||
bot.listen()
|
bot.listen()
|
||||||
except KeyboardInterrupt:
|
|
||||||
logger.info("Exited.")
|
|
||||||
sys.exit(0)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
enter_to_exit()
|
enter_to_exit()
|
||||||
|
|||||||
Reference in New Issue
Block a user