Added dice roller

This commit is contained in:
2023-09-12 11:09:27 +10:00
parent 3d51687b51
commit c2ea96445d
3 changed files with 31 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
import random
import discord import discord
import sqlite3 import sqlite3
from discord import app_commands from discord import app_commands
@@ -122,6 +123,20 @@ async def gg(interaction: discord.Interaction):
game = pick_game() game = pick_game()
await interaction.response.send_message("Barotrauma") await interaction.response.send_message("Barotrauma")
@tree.command(description="Roll a Dice")
@app_commands.choices(dice = [
app_commands.Choice(name = 'd4', value=4),
app_commands.Choice(name = 'd6', value=6),
app_commands.Choice(name = 'd8', value=8),
app_commands.Choice(name = 'd10', value=10),
app_commands.Choice(name = 'd12', value=12),
app_commands.Choice(name = 'd20', value=20),
app_commands.Choice(name = 'd100', value=100),
])
async def roll(interaction: discord.Interaction, dice:app_commands.Choice[int]):
roll = random.randint(1, dice.value)
await interaction.response.send_message(f"{dice.name}: {roll}")
""" """
#### Fin #### #### Fin ####

View File

@@ -2,18 +2,22 @@ import discord
import random import random
# Temporary List # Temporary List
games = ["Left 4 Dead 2", # games = ["Left 4 Dead 2",
"Aragami", # "Aragami",
"Astroneer", # "Astroneer",
"Factorio", # "Factorio",
"Borderlands", # "Borderlands",
"Stardew Valley", # "Stardew Valley",
"Viscera Cleanup Detail", # "Viscera Cleanup Detail",
"SCP", # "SCP",
"Satisfactory", # "Satisfactory",
"Backrooms (Alternate Ending)", # "Backrooms (Alternate Ending)",
"Ghost Recon Wildlands" # "Ghost Recon Wildlands"
] # ]
games = ["Plate Up",
"Terraria",
"Ghost Recon"]
def add_game(game: str): def add_game(game: str):
games.append(game) games.append(game)

BIN
ledger.db

Binary file not shown.