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 ####
|
||||
|
||||
Reference in New Issue
Block a user