smoll update regarding webhoooks
This commit is contained in:
parent
3518a9f957
commit
a9c694e63f
22
V4.py
22
V4.py
|
@ -45,10 +45,11 @@ g = open(MotPath, "r" , encoding="utf-8")
|
||||||
Liste_de_mot=(list(g.readline().split(',')))
|
Liste_de_mot=(list(g.readline().split(',')))
|
||||||
g.close()
|
g.close()
|
||||||
g = open(WebHookPath,"r")
|
g = open(WebHookPath,"r")
|
||||||
SuccesLink, ErrorLink = g.readline().split(',')
|
SuccessLink, ErrorLink = g.readline().split(',')
|
||||||
g.close
|
g.close
|
||||||
|
|
||||||
|
webhookSuccess = Webhook.from_url(SuccessLink, adapter=RequestsWebhookAdapter())
|
||||||
|
webhookFailure = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter())
|
||||||
|
|
||||||
def resource_path(relative_path): #permet de recuperer l'emplacement de chaque fichier, su linux et windows
|
def resource_path(relative_path): #permet de recuperer l'emplacement de chaque fichier, su linux et windows
|
||||||
try:
|
try:
|
||||||
|
@ -140,14 +141,13 @@ def LogError(message,log = Log, Mobdriver = None):
|
||||||
|
|
||||||
gdriver.save_screenshot("screenshot.png")
|
gdriver.save_screenshot("screenshot.png")
|
||||||
|
|
||||||
webhook = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter()) # Initializing webhook
|
webhookFailure.send(content="------------------------------------\n" + _mail)
|
||||||
webhook.send(content="------------------------------------\n" + _mail)
|
webhookFailure.send(ListTabs(Mdriver=Mobdriver))
|
||||||
webhook.send(ListTabs(Mdriver=Mobdriver))
|
webhookFailure.send(str(message))
|
||||||
webhook.send(str(message))
|
|
||||||
CustomSleep(1)
|
CustomSleep(1)
|
||||||
webhook.send(file=discord.File('screenshot.png'))
|
webhookFailure.send(file=discord.File('screenshot.png'))
|
||||||
webhook.send(file=discord.File('page.html'))
|
webhookFailure.send(file=discord.File('page.html'))
|
||||||
webhook.send("------------------------------------")
|
webhookFailure.send("------------------------------------")
|
||||||
|
|
||||||
|
|
||||||
def progressBar(current, total=30, barLength = 20, name ="Progress"):
|
def progressBar(current, total=30, barLength = 20, name ="Progress"):
|
||||||
|
@ -657,8 +657,8 @@ def LogPoint(account="unknown"): #log des points sur discord
|
||||||
|
|
||||||
account = account.split('@')[0]
|
account = account.split('@')[0]
|
||||||
|
|
||||||
webhook = Webhook.from_url(ErrorLink, adapter=RequestsWebhookAdapter())
|
|
||||||
webhook.send(f'{account} actuellement à {str(point)} points')
|
webhookSuccess.send(f'{account} actuellement à {str(point)} points')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue