This commit is contained in:
insert 2024-08-10 23:13:17 -04:00
parent 6173c2944a
commit a1d80c0d05
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -99,11 +99,14 @@ class gameutils(commands.Cog):
default_member_permissions=nextcord.Permissions(manage_roles=True), default_member_permissions=nextcord.Permissions(manage_roles=True),
) )
@nextcord.ext.application_checks.has_permissions(manage_roles=True) @nextcord.ext.application_checks.has_permissions(manage_roles=True)
async def turngen(self, interaction: nextcord.Interaction, number: int, sides: int, hidden: str = nextcord.SlashOption(choices={"Yes": True, "No": False})): async def turngen(self, interaction: nextcord.Interaction, number: int, sides: int, hidden: str = nextcord.SlashOption(choices=["Yes", "No"])):
message = f"May the odds ever be in your favor...\n" message = f"May the odds ever be in your favor...\n"
for d in range(number): for d in range(number):
message = message + f":game_die:1. {str(random.randint(1, sides))}" message = message + f":game_die:{str(d+1)}. {str(random.randint(1, sides))}\n"
await interaction.response.send_message(message, ephemeral=hidden) if hidden == "Yes":
await interaction.response.send_message(message, ephemeral=True)
else:
await interaction.response.send_message(message, ephemeral=False)