Fix randomization, added 2 workouts
This commit is contained in:
@@ -12,3 +12,5 @@ SQUATS=5
|
||||
LUNGES=2
|
||||
RUSSIAN_TWISTS=3
|
||||
WALL_PUSHUPS=5
|
||||
BIRD_DOG=4
|
||||
HIP_THRUSTS=5
|
||||
@@ -246,7 +246,7 @@ def register(tree: app_commands.CommandTree):
|
||||
@tree.command(name="workout", description="Get a random workout")
|
||||
async def workout(interaction: discord.Interaction):
|
||||
enabled = [w for w, v in WORKOUTS.items() if v > 0]
|
||||
choice = random.choice(enabled)
|
||||
choice = random.SystemRandom().choice(enabled)
|
||||
|
||||
await interaction.response.send_message(
|
||||
f"💪 **{choice}**\n"
|
||||
|
||||
@@ -28,6 +28,8 @@ WORKOUTS = {
|
||||
"Lunges": env_int("LUNGES"),
|
||||
"Russian Twists": env_int("RUSSIAN_TWISTS"),
|
||||
"Wall Pushups": env_int("WALL_PUSHUPS"),
|
||||
"Bird Dog": env_int("BIRD_DOG"),
|
||||
"Hip Thrusts": env_int("HIP_THRUSTS"),
|
||||
}
|
||||
|
||||
WORKOUT_CALORIES = {
|
||||
@@ -38,6 +40,8 @@ WORKOUT_CALORIES = {
|
||||
"Lunges": 0.2,
|
||||
"Russian Twists": 0.2,
|
||||
"Wall Pushups": 0.1,
|
||||
"Bird Dog": 0.1,
|
||||
"Hip Thrusts": 0.5,
|
||||
}
|
||||
|
||||
ENABLED_WORKOUTS = {
|
||||
|
||||
Reference in New Issue
Block a user