|
|
|
@@ -39,7 +39,7 @@ def ping(update, context): |
|
|
|
|
|
|
|
def init(update, context): |
|
|
|
update.message.reply_text("Tentative de connexion à Betaseries...") |
|
|
|
data = login_beta(update, context) |
|
|
|
data = login_beta() |
|
|
|
if data == False : |
|
|
|
error = "Impossible d'interroger l'API\n Code:" + str(request.status_code) |
|
|
|
update.message.reply_text(error) |
|
|
|
@@ -55,11 +55,11 @@ def init(update, context): |
|
|
|
Notification = API_Message + " Votre Token sur Betaseries: " + betauser |
|
|
|
request = requests.post(Notification) |
|
|
|
update.message.reply_text("Vous pouvez maintenant utiliser le bot !") |
|
|
|
|
|
|
|
print("Token Betaseries :", betauser) |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
def login_beta(update, context): |
|
|
|
def login_beta(): |
|
|
|
global betauser |
|
|
|
print("Connexion a Betaseries en cours...") |
|
|
|
API_auth = 'https://api.betaseries.com/members/auth' |
|
|
|
@@ -68,11 +68,10 @@ def login_beta(update, context): |
|
|
|
if str(request) != '<Response [200]>' : |
|
|
|
return False |
|
|
|
data = request.json() |
|
|
|
betauser = data['token'] |
|
|
|
|
|
|
|
betauser = str(data['token']) |
|
|
|
return betauser |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def repeat(update, context): |
|
|
|
message = '' |
|
|
|
user = update.message.from_user |
|
|
|
|