add embed switch
This commit is contained in:
commit
9f15cc6ed5
57
V4.py
57
V4.py
|
@ -1,26 +1,28 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
import os
|
|
||||||
from time import sleep
|
|
||||||
from random import uniform, choice, randint,shuffle
|
|
||||||
from re import search,findall
|
|
||||||
from os import path, sys, system
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from sys import platform
|
import os
|
||||||
from csv import reader
|
from csv import reader
|
||||||
from discord import Webhook, RequestsWebhookAdapter, File # Importing discord.Webhook and discord.RequestsWebhookAdapter
|
from os import path, sys, system
|
||||||
|
from random import choice, randint, shuffle, uniform
|
||||||
|
from re import findall, search
|
||||||
|
from sys import platform
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
|
import discord
|
||||||
|
from discord import ( # Importing discord.Webhook and discord.RequestsWebhookAdapter
|
||||||
|
Colour, Embed, RequestsWebhookAdapter, Webhook)
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.firefox.options import Options
|
|
||||||
from selenium.webdriver.common.keys import Keys
|
|
||||||
from selenium.webdriver.common.by import By
|
|
||||||
from selenium.webdriver.support.ui import WebDriverWait
|
|
||||||
from selenium.webdriver.support import expected_conditions as EC
|
|
||||||
from selenium.common import exceptions
|
from selenium.common import exceptions
|
||||||
|
from selenium.webdriver.common.by import By
|
||||||
|
from selenium.webdriver.common.keys import Keys
|
||||||
|
from selenium.webdriver.firefox.options import Options
|
||||||
|
from selenium.webdriver.support import expected_conditions as EC
|
||||||
|
from selenium.webdriver.support.ui import WebDriverWait
|
||||||
|
|
||||||
main = True
|
main = True
|
||||||
Headless = True
|
Headless = True
|
||||||
Log = False
|
Log = False
|
||||||
|
SucessEmbed = False
|
||||||
|
|
||||||
|
|
||||||
IsLinux = platform == "linux"
|
IsLinux = platform == "linux"
|
||||||
|
@ -140,13 +142,17 @@ def LogError(message,log = Log, Mobdriver = None):
|
||||||
|
|
||||||
gdriver.save_screenshot("screenshot.png")
|
gdriver.save_screenshot("screenshot.png")
|
||||||
|
|
||||||
webhookFailure.send(content="------------------------------------\n" + _mail)
|
embed = discord.Embed(
|
||||||
webhookFailure.send(ListTabs(Mdriver=Mobdriver))
|
title="An Error has occured",
|
||||||
webhookFailure.send(str(message))
|
description=str(message),
|
||||||
CustomSleep(1)
|
url = ListTabs(Mdriver=Mobdriver)[0],
|
||||||
webhookFailure.send(file=discord.File('screenshot.png'))
|
colour = Colour.red()
|
||||||
|
)
|
||||||
|
file = discord.File("screenshot.png")
|
||||||
|
embed.set_image(url="attachment://screenshot.png")
|
||||||
|
embed.set_footer(text=_mail)
|
||||||
|
webhookFailure.send(embed=embed, file=file)
|
||||||
webhookFailure.send(file=discord.File('page.html'))
|
webhookFailure.send(file=discord.File('page.html'))
|
||||||
webhookFailure.send("------------------------------------")
|
|
||||||
|
|
||||||
|
|
||||||
def progressBar(current, total=30, barLength = 20, name ="Progress"):
|
def progressBar(current, total=30, barLength = 20, name ="Progress"):
|
||||||
|
@ -654,10 +660,15 @@ def LogPoint(account="unknown"): #log des points sur discord
|
||||||
CustomSleep(uniform(3,20))
|
CustomSleep(uniform(3,20))
|
||||||
|
|
||||||
account = account.split('@')[0]
|
account = account.split('@')[0]
|
||||||
|
if SucessEmbed :
|
||||||
|
embed = discord.Embed(
|
||||||
webhookSuccess.send(f'{account} actuellement à {str(point)} points')
|
title=f"{account} actuellement à {str(point)} points",
|
||||||
|
colour = Colour.green()
|
||||||
|
)
|
||||||
|
embed.set_footer(text=_mail)
|
||||||
|
webhookSuccess.send(embed=embed)
|
||||||
|
else :
|
||||||
|
webhookSuccess.send(_mail + "actuellement à" +str(point) + "points")
|
||||||
|
|
||||||
|
|
||||||
def Fidelité():
|
def Fidelité():
|
||||||
|
|
Loading…
Reference in New Issue