Added dice roller
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import random
|
||||
import discord
|
||||
import sqlite3
|
||||
from discord import app_commands
|
||||
@@ -122,6 +123,20 @@ async def gg(interaction: discord.Interaction):
|
||||
game = pick_game()
|
||||
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 ####
|
||||
|
||||
@@ -2,18 +2,22 @@ import discord
|
||||
import random
|
||||
|
||||
# Temporary List
|
||||
games = ["Left 4 Dead 2",
|
||||
"Aragami",
|
||||
"Astroneer",
|
||||
"Factorio",
|
||||
"Borderlands",
|
||||
"Stardew Valley",
|
||||
"Viscera Cleanup Detail",
|
||||
"SCP",
|
||||
"Satisfactory",
|
||||
"Backrooms (Alternate Ending)",
|
||||
"Ghost Recon Wildlands"
|
||||
]
|
||||
# games = ["Left 4 Dead 2",
|
||||
# "Aragami",
|
||||
# "Astroneer",
|
||||
# "Factorio",
|
||||
# "Borderlands",
|
||||
# "Stardew Valley",
|
||||
# "Viscera Cleanup Detail",
|
||||
# "SCP",
|
||||
# "Satisfactory",
|
||||
# "Backrooms (Alternate Ending)",
|
||||
# "Ghost Recon Wildlands"
|
||||
# ]
|
||||
|
||||
games = ["Plate Up",
|
||||
"Terraria",
|
||||
"Ghost Recon"]
|
||||
|
||||
def add_game(game: str):
|
||||
games.append(game)
|
||||
|
||||
Reference in New Issue
Block a user