show full auto only if has beta access

This commit is contained in:
Adam Saudagar 2020-11-03 00:34:50 +05:30
parent 7e00771887
commit 721c2ae7ce
3 changed files with 17 additions and 2 deletions

View File

@ -3,6 +3,7 @@ from tkinter import OptionMenu, Button, IntVar
from typing import List, Callable, Optional
import threading
from fishy.web import web
from ttkthemes import ThemedTk
from fishy.engine.common.event_handler import EngineEventHandler
@ -52,10 +53,11 @@ class GUI:
@property
def engines(self):
engines = {
"Semi Fisher": [lambda: config_top.start_semifisher_config(self), self.engine.toggle_semifisher],
"Semi Fisher": [lambda: config_top.start_semifisher_config(self), # start config function
self.engine.toggle_semifisher], # start engine function
}
if config.get('debug', False):
if web.has_beta():
engines["Full-Auto Fisher"] = [lambda: config_top.start_fullfisher_config(self),
self.engine.toggle_fullfisher]
return engines

View File

@ -14,6 +14,7 @@ hole_depleted = domain + "/api/hole_depleted"
session = domain + "/api/session"
terms = domain + "/terms.html"
discord = domain + "/api/discord"
beta = domain + "/api/beta"
def get_notification_page(uid):

View File

@ -127,3 +127,15 @@ def get_session(lazy=True):
_session_id = response.json()["session_id"]
return _session_id
@fallback(False)
def has_beta():
body = {'uid': config.get("uid")}
response = requests.get(urls.beta, params=body)
result = response.json()
if not result["success"]:
return False
return response.json()["beta"]