removed a lot of unused command line parameters
This commit is contained in:
parent
35c846e671
commit
2cc1fcbc72
|
@ -4,45 +4,14 @@ from modules.imports import *
|
||||||
import modules.globals as g
|
import modules.globals as g
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
class FakeWebHook:
|
class FakeWebHook:
|
||||||
def send(self, text="", username='', avatar_url='', embed="", file=""):
|
def send(self, text="", username='', avatar_url='', embed="", file=""):
|
||||||
print(text)
|
print(text)
|
||||||
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"-o",
|
|
||||||
"--override",
|
|
||||||
help="override",
|
|
||||||
dest="override",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"-u",
|
|
||||||
"--unban",
|
|
||||||
help="unban an account",
|
|
||||||
dest="unban",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"-fl",
|
|
||||||
"--fulllog",
|
|
||||||
dest="fulllog",
|
|
||||||
help="enable full logging in discord",
|
|
||||||
action="store_true",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
|
||||||
"-d",
|
|
||||||
"--dev",
|
|
||||||
dest="dev",
|
|
||||||
help="enable dev mode",
|
|
||||||
action="store_true",
|
|
||||||
)
|
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-c",
|
"-c",
|
||||||
"--config",
|
"--config",
|
||||||
|
@ -50,7 +19,6 @@ parser.add_argument(
|
||||||
default=""
|
default=""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-v",
|
"-v",
|
||||||
"--vnc",
|
"--vnc",
|
||||||
|
@ -66,8 +34,8 @@ parser.add_argument(
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--very-custom",
|
"--json",
|
||||||
help="Choose a specific config file",
|
help="input json to start the bot with custom parameters",
|
||||||
default=""
|
default=""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -80,31 +48,21 @@ with open("/app/MsRewards-Reborn/user_data/proxy.json", "r") as inFile:
|
||||||
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
with open("/app/MsRewards-Reborn/user_data/configs.json", "r") as inFile:
|
||||||
config = json.load(inFile)
|
config = json.load(inFile)
|
||||||
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
g.custom_start = args.override
|
g.json_start = args.json
|
||||||
g.unban = args.unban
|
|
||||||
g.full_log = args.fulllog
|
|
||||||
g.dev = args.dev
|
|
||||||
g.very_custom = args.very_custom
|
|
||||||
|
|
||||||
if g.custom_start :
|
|
||||||
g.log = True
|
|
||||||
|
|
||||||
g.vnc_enabled = args.vnc != "None"
|
g.vnc_enabled = args.vnc != "None"
|
||||||
g.vnc_port = args.vnc
|
g.vnc_port = args.vnc
|
||||||
g.update_version = args.update_version
|
g.update_version = args.update_version
|
||||||
# global variables used later in the code
|
# global variables used later in the code
|
||||||
g.islinux = platform == "linux" # if the computer running this program is Linux, it allow more things
|
|
||||||
g.start_time = time()
|
|
||||||
|
|
||||||
|
g.start_time = time()
|
||||||
|
|
||||||
# path configurations
|
# path configurations
|
||||||
g.mot_path = "/usr/share/dict/french"
|
g.mot_path = "/usr/share/dict/french"
|
||||||
g.credential_path = "/app/MsRewards-Reborn/user_data/login.csv"
|
g.credential_path = "/app/MsRewards-Reborn/user_data/login.csv"
|
||||||
|
|
||||||
|
|
||||||
discord_conf = config[args.config]["discord"]
|
discord_conf = config[args.config]["discord"]
|
||||||
|
|
||||||
# discord configuration
|
# discord configuration
|
||||||
|
@ -115,7 +73,7 @@ g.discord_enabled_success = discord[discord_conf]["successT"] == "True"
|
||||||
|
|
||||||
g.avatar_url = settings["avatarlink"]
|
g.avatar_url = settings["avatarlink"]
|
||||||
|
|
||||||
if not g.very_custom :
|
if not g.json_start:
|
||||||
if g.discord_enabled_error:
|
if g.discord_enabled_error:
|
||||||
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
|
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
|
||||||
if g.discord_enabled_success:
|
if g.discord_enabled_success:
|
||||||
|
@ -123,6 +81,8 @@ if not g.very_custom :
|
||||||
else:
|
else:
|
||||||
webhookFailure = FakeWebHook()
|
webhookFailure = FakeWebHook()
|
||||||
webhookSuccess = FakeWebHook()
|
webhookSuccess = FakeWebHook()
|
||||||
|
|
||||||
|
|
||||||
# base settings
|
# base settings
|
||||||
g.discord_embed = False # send new point value in an embed, fixed for now
|
g.discord_embed = False # send new point value in an embed, fixed for now
|
||||||
g.headless = False
|
g.headless = False
|
||||||
|
@ -134,20 +94,14 @@ if g.proxy_enabled :
|
||||||
g.proxy_port = proxy[config[args.config]["proxy"]]["port"]
|
g.proxy_port = proxy[config[args.config]["proxy"]]["port"]
|
||||||
|
|
||||||
|
|
||||||
g.fast = False
|
|
||||||
|
|
||||||
# list of words
|
# list of words
|
||||||
h = open(g.mot_path, "r", encoding="utf-8")
|
with open(g.mot_path, "r", encoding="utf-8") as h:
|
||||||
lines = h.readlines()
|
lines = h.readlines()
|
||||||
if len(lines) < 3:
|
if len(lines) < 3:
|
||||||
Liste_de_mot = list(lines[0].split(","))
|
Liste_de_mot = list(lines[0].split(","))
|
||||||
else:
|
else:
|
||||||
Liste_de_mot = [x.replace('\n', "") for x in lines]
|
Liste_de_mot = [x.replace('\n', "") for x in lines]
|
||||||
h.close()
|
|
||||||
|
|
||||||
|
|
||||||
Credentials = [ (config[args.config]['accounts'][x]["mail"],config[args.config]['accounts'][x]["pwd"],config[args.config]['accounts'][x]["2fa"]) for x in config[args.config]['accounts']]
|
|
||||||
g._cred = Credentials
|
|
||||||
|
|
||||||
if g.proxy_enabled:
|
if g.proxy_enabled:
|
||||||
setup_proxy(g.proxy_address, g.proxy_port)
|
setup_proxy(g.proxy_address, g.proxy_port)
|
||||||
|
|
Loading…
Reference in New Issue