From 34d71f3aa3a179eb659cc2789ce746d47c5b462d Mon Sep 17 00:00:00 2001 From: swee Date: Wed, 11 Dec 2024 12:54:12 -0800 Subject: [PATCH] Update server.py --- server.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 52c1b14..e0cea6d 100644 --- a/server.py +++ b/server.py @@ -2,7 +2,7 @@ __version__ = "0.0.1-pre-alpha" print(f"INTERNET RELAY CAT v{__version__}") print("Welcome! /ᐠ ˵> ⩊ <˵マ") -import socket, time, threading, traceback, sys, subprocess, yaml +import socket, time, threading, traceback, sys, subprocess, yaml, sqlite3 from requests import get if not len(sys.argv) == 2: print("IRCat requires the following arguments: config.yml") @@ -10,6 +10,8 @@ if not len(sys.argv) == 2: server = "127.0.0.1" displayname = "foo" identifier = "somewhere in the universe" +admin_nick = "admin" +data_path = "" with open(sys.argv[1], 'r') as file: data = yaml.safe_load(file) try: server = data["host"] @@ -18,6 +20,12 @@ with open(sys.argv[1], 'r') as file: except: print("using fallback display name") try: identifier = data["identifier"] except: print("using fallback identifier") + try: admin_nick = data["admin-nick"] + except: print("using fallback admin nick") + try: data_path = data["data-path"] + except: + print("IRCat requires \"data-path\" in config.yml") + sys.exit(1) file.close() print("Successfully loaded config!") ip = get('https://api.ipify.org').content.decode('utf8')