remove .can_gamble
parent
0435081198
commit
ac98f54902
|
@ -125,7 +125,6 @@ class User(Base):
|
||||||
ban_evade = Column(Integer, default=0)
|
ban_evade = Column(Integer, default=0)
|
||||||
original_username = Column(String)
|
original_username = Column(String)
|
||||||
referred_by = Column(Integer, ForeignKey("users.id"))
|
referred_by = Column(Integer, ForeignKey("users.id"))
|
||||||
can_gamble = Column(Boolean, default=True)
|
|
||||||
currently_held_lottery_tickets = Column(Integer, default=0)
|
currently_held_lottery_tickets = Column(Integer, default=0)
|
||||||
total_held_lottery_tickets = Column(Integer, default=0)
|
total_held_lottery_tickets = Column(Integer, default=0)
|
||||||
total_lottery_winnings = Column(Integer, default=0)
|
total_lottery_winnings = Column(Integer, default=0)
|
||||||
|
|
|
@ -52,8 +52,7 @@ def format_all(player_hand, dealer_hand, deck, status, wager, kind, is_insured=0
|
||||||
|
|
||||||
|
|
||||||
def check_for_blackjack_commands(in_text, from_user, from_comment):
|
def check_for_blackjack_commands(in_text, from_user, from_comment):
|
||||||
if not FEATURES['GAMBLING'] or not from_user.can_gamble:
|
if not FEATURES['GAMBLING']: return
|
||||||
return
|
|
||||||
|
|
||||||
for command_word in (coins_command_word, marseybux_command_word):
|
for command_word in (coins_command_word, marseybux_command_word):
|
||||||
currency_prop = "coins" if command_word == coins_command_word else "procoins"
|
currency_prop = "coins" if command_word == coins_command_word else "procoins"
|
||||||
|
|
|
@ -19,8 +19,7 @@ def shuffle(stuff):
|
||||||
return stuff
|
return stuff
|
||||||
|
|
||||||
def check_for_slots_command(in_text, from_user, from_comment):
|
def check_for_slots_command(in_text, from_user, from_comment):
|
||||||
if not FEATURES['GAMBLING'] or not from_user.can_gamble:
|
if not FEATURES['GAMBLING']: return
|
||||||
return
|
|
||||||
|
|
||||||
in_text = in_text.lower()
|
in_text = in_text.lower()
|
||||||
if command_word in in_text:
|
if command_word in in_text:
|
||||||
|
|
|
@ -12,8 +12,7 @@ lotterizer_rate = 33
|
||||||
def check_for_treasure(in_text, from_comment):
|
def check_for_treasure(in_text, from_comment):
|
||||||
user = from_comment.author
|
user = from_comment.author
|
||||||
|
|
||||||
if not FEATURES['GAMBLING'] or not user.can_gamble:
|
if not FEATURES['GAMBLING']: return
|
||||||
return
|
|
||||||
|
|
||||||
if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text:
|
if '!slots' not in in_text and '!blackjack' not in in_text and '!wordle' not in in_text:
|
||||||
seed = randint(1, 1000)
|
seed = randint(1, 1000)
|
||||||
|
|
|
@ -171,7 +171,6 @@ def lottery_required(f):
|
||||||
v = get_logged_in_user()
|
v = get_logged_in_user()
|
||||||
|
|
||||||
if not LOTTERY_ENABLED: abort(404)
|
if not LOTTERY_ENABLED: abort(404)
|
||||||
if v and not v.can_gamble: abort(403)
|
|
||||||
|
|
||||||
return make_response(f(v=v))
|
return make_response(f(v=v))
|
||||||
|
|
||||||
|
|
|
@ -72,10 +72,6 @@ def settings_profile_post(v):
|
||||||
updated = True
|
updated = True
|
||||||
v.newtabexternal = request.values.get("newtabexternal") == 'true'
|
v.newtabexternal = request.values.get("newtabexternal") == 'true'
|
||||||
|
|
||||||
elif request.values.get("can_gamble", v.can_gamble) != v.can_gamble:
|
|
||||||
updated = True
|
|
||||||
v.can_gamble = request.values.get("can_gamble") == 'true'
|
|
||||||
|
|
||||||
elif request.values.get("nitter", v.nitter) != v.nitter:
|
elif request.values.get("nitter", v.nitter) != v.nitter:
|
||||||
updated = True
|
updated = True
|
||||||
v.nitter = request.values.get("nitter") == 'true'
|
v.nitter = request.values.get("nitter") == 'true'
|
||||||
|
|
|
@ -123,7 +123,7 @@
|
||||||
|
|
||||||
<a class="mobile-nav-icon d-md-none" href="/random_user"><i class="fas fa-music align-middle text-gray-500 black"></i></a>
|
<a class="mobile-nav-icon d-md-none" href="/random_user"><i class="fas fa-music align-middle text-gray-500 black"></i></a>
|
||||||
|
|
||||||
{% if v and v.can_gamble and LOTTERY_ENABLED %}
|
{% if v and LOTTERY_ENABLED %}
|
||||||
<a class="mobile-nav-icon d-md-none" href="/lottery">
|
<a class="mobile-nav-icon d-md-none" href="/lottery">
|
||||||
<i class="fas fa-ticket align-middle text-gray-500 black"></i>
|
<i class="fas fa-ticket align-middle text-gray-500 black"></i>
|
||||||
</a>
|
</a>
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
<a class="nav-link" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User"><i class="fas fa-music"></i></a>
|
<a class="nav-link" href="/random_user" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Random User"><i class="fas fa-music"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% if v.can_gamble and LOTTERY_ENABLED %}
|
{% if LOTTERY_ENABLED %}
|
||||||
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
<li class="nav-item d-flex align-items-center justify-content-center text-center mx-1">
|
||||||
<a class="nav-link" href="/lottery" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Lottery"><i class="fas fa-ticket"></i></a>
|
<a class="nav-link" href="/lottery" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Lottery"><i class="fas fa-ticket"></i></a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -168,23 +168,6 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2 class="h5">Gambling</h2>
|
|
||||||
<div class="settings-section rounded">
|
|
||||||
<div class="d-lg-flex border-bottom">
|
|
||||||
<div class="title w-lg-25">
|
|
||||||
<label for="can_gamble">Can Gamble</label>
|
|
||||||
</div>
|
|
||||||
<div class="body w-lg-100">
|
|
||||||
<div class="custom-control custom-switch">
|
|
||||||
<input autocomplete="off" type="checkbox" class="custom-control-input" id="can_gamble" name="can_gamble"{% if v.can_gamble %} checked{% endif %} onchange="post_toast(this,'/settings/profile?can_gamble='+document.getElementById('can_gamble').checked);">
|
|
||||||
<label class="custom-control-label" for="can_gamble"></label>
|
|
||||||
</div>
|
|
||||||
<span class="text-small text-muted">Disable to prevent use of blackjack, slots, treasure chests, the lottery, and betting polls.</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<h2 class="h5">Twitter Links</h2>
|
<h2 class="h5">Twitter Links</h2>
|
||||||
|
|
||||||
<div class="settings-section rounded">
|
<div class="settings-section rounded">
|
||||||
|
|
|
@ -851,7 +851,6 @@ CREATE TABLE public.users (
|
||||||
currently_held_lottery_tickets integer DEFAULT 0 NOT NULL,
|
currently_held_lottery_tickets integer DEFAULT 0 NOT NULL,
|
||||||
total_held_lottery_tickets integer DEFAULT 0 NOT NULL,
|
total_held_lottery_tickets integer DEFAULT 0 NOT NULL,
|
||||||
total_lottery_winnings integer DEFAULT 0 NOT NULL,
|
total_lottery_winnings integer DEFAULT 0 NOT NULL,
|
||||||
can_gamble boolean DEFAULT true NOT NULL,
|
|
||||||
offsitementions boolean DEFAULT false NOT NULL,
|
offsitementions boolean DEFAULT false NOT NULL,
|
||||||
last_active integer DEFAULT 0 NOT NULL,
|
last_active integer DEFAULT 0 NOT NULL,
|
||||||
poorcel boolean DEFAULT false NOT NULL,
|
poorcel boolean DEFAULT false NOT NULL,
|
||||||
|
|
Loading…
Reference in New Issue