forked from rDrama/rDrama
fix snappy gambling
parent
d616086dbd
commit
fbddf3e59c
|
@ -3,7 +3,7 @@ from files.helpers.alerts import send_repeatable_notification
|
|||
from files.helpers.const import *
|
||||
from files.helpers.get import *
|
||||
from files.helpers.sanitize import *
|
||||
from files.helpers.slots import execute_slots_command
|
||||
from files.helpers.slots import check_slots_command
|
||||
import random
|
||||
from urllib.parse import quote
|
||||
|
||||
|
@ -145,12 +145,12 @@ def execute_snappy(post, v):
|
|||
|
||||
g.db.add(c)
|
||||
|
||||
check_slots_command(v, snappy, c)
|
||||
|
||||
snappy.comment_count += 1
|
||||
snappy.coins += 1
|
||||
g.db.add(snappy)
|
||||
|
||||
execute_slots_command(snappy, v, c)
|
||||
|
||||
if FEATURES['PINS'] and (body.startswith(':#marseypin:') or body.startswith(':#marseypin2:')):
|
||||
post.stickied = "Snappy"
|
||||
post.stickied_utc = int(time.time()) + 3600
|
||||
|
|
|
@ -51,7 +51,7 @@ def casino_slot_pull(gambler, wager_value, currency):
|
|||
|
||||
return casino_game.id, casino_game.game_state
|
||||
else:
|
||||
return 0, "{}",
|
||||
return None, "{}",
|
||||
|
||||
|
||||
def build_symbols(for_payout):
|
||||
|
@ -117,7 +117,7 @@ def shuffle(stuff):
|
|||
return stuff
|
||||
|
||||
|
||||
def execute_slots_command(v:User, u:User, c:Comment):
|
||||
def check_slots_command(v:User, u:User, c:Comment):
|
||||
if not FEATURES['GAMBLING']: return
|
||||
body = c.body.lower()
|
||||
|
||||
|
@ -153,5 +153,5 @@ def execute_slots_command(v:User, u:User, c:Comment):
|
|||
abort(400, f"Not enough {currency} to make that bet")
|
||||
return
|
||||
|
||||
game_id, game_state = casino_slot_pull(v, wager, currency)
|
||||
game_id, game_state = casino_slot_pull(u, wager, currency)
|
||||
c.casino_game_id = game_id
|
||||
|
|
|
@ -357,7 +357,7 @@ def comment(v):
|
|||
parent_post.comment_count += 1
|
||||
g.db.add(parent_post)
|
||||
|
||||
execute_slots_command(v, v, c)
|
||||
check_slots_command(v, v, c)
|
||||
|
||||
g.db.flush()
|
||||
|
||||
|
|
Loading…
Reference in New Issue