From c2ea96445dbeddaba0f25a51642c23576dbbe4f0 Mon Sep 17 00:00:00 2001 From: BigGamerGary Date: Tue, 12 Sep 2023 11:09:27 +1000 Subject: [PATCH] Added dice roller --- Acronymbot.py | 15 +++++++++++++++ Gamepicker.py | 28 ++++++++++++++++------------ ledger.db | Bin 8192 -> 8192 bytes 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/Acronymbot.py b/Acronymbot.py index 8d85260..3ff69b2 100644 --- a/Acronymbot.py +++ b/Acronymbot.py @@ -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 #### diff --git a/Gamepicker.py b/Gamepicker.py index fd5cfe4..7d19e33 100644 --- a/Gamepicker.py +++ b/Gamepicker.py @@ -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) diff --git a/ledger.db b/ledger.db index 556beafda079f5a74989078717e6fc3b37b89e99..add31d7b5f2cdfe9f3973260552c916a183bc64e 100644 GIT binary patch delta 61 zcmZp0XmFSy&3JX9j5GgL2EDXbybKHsjQpYu{Gyu$1(x$|7UjPpAbv)MTZoB`fsKig Rk;$@lN(~bOgY1UjH~{J44rBlT delta 61 zcmZp0XmFSy&3JjDj5Ggb2EBM`UIqpRMt)HSe$mZ>0?YX}i}GI)5NDC*7Gh#!U}Iur RWU{QCQp3c+ASV(W3jnW=3?%>n