faire git pull = être un gros fou, j'ai rien tester

This commit is contained in:
piair
2023-09-30 17:23:37 +02:00
parent 92ee7da9a4
commit e21ee8b5a4
5 changed files with 68 additions and 9 deletions

View File

@ -4,6 +4,10 @@ from modules.imports import *
import modules.globals as g
import json
class FakeWebHook:
def send(self, text = "", username='', avatar_url='', embed = "", file =""):
print(text)
parser = argparse.ArgumentParser()
parser.add_argument(
@ -62,6 +66,12 @@ parser.add_argument(
default="None"
)
parser.add_argument(
"--very-custom",
help="Choose a specific config file",
default=""
)
with open("/app/MsRewards-Reborn/user_data/discord.json", "r") as inFile:
discord = json.load(inFile)
with open("/app/MsRewards-Reborn/user_data/settings.json", "r") as inFile:
@ -78,6 +88,8 @@ g.custom_start = args.override
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
@ -104,12 +116,14 @@ g.discord_enabled_success = discord[discord_conf]["successT"] == "True"
g.avatar_url = settings["avatarlink"]
if g.discord_enabled_error:
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
if g.discord_enabled_success:
webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter())
if not very_custom :
if g.discord_enabled_error:
webhookFailure = Webhook.from_url(g.discord_error_link, adapter=RequestsWebhookAdapter())
if g.discord_enabled_success:
webhookSuccess = Webhook.from_url(g.discord_success_link, adapter=RequestsWebhookAdapter())
else :
webhookFailure = FakeWebHook()
webhookSuccess = FakeWebHook()
# base settings
g.discord_embed = False # send new point value in an embed, fixed for now
g.headless = False