Skip to content

Commit

Permalink
Add dice (#222)
Browse files Browse the repository at this point in the history
* Add dice

* Fix syntax error
  • Loading branch information
ibanner56 authored Oct 29, 2024
1 parent 2f1ff12 commit 8f5105d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions otherdave/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from discord.ext import tasks, commands
from otherdave.commands import *
from otherdave.util import *
import random
from typing import Literal, Optional

# Configure client
Expand Down Expand Up @@ -60,6 +61,19 @@ async def ctx_daddy(interaction: discord.Interaction, message: discord.Message)
async def cmd_dad(interaction: discord.Interaction) -> None:
await interaction.response.send_message(jabber.dad())

@client.tree.command(
name = "die",
description = "Rollin' stones."
)
@app_commands.check(callerNotIgnored)
async def cmd_die(interaction: discord.Interaction, sides: int):
roll = 0
if (interaction.user.id == 442747712400654337):
roll = random.random() * sides
else:
roll = random.randint(1, sides)
await interaction.response.send_message("Uhhhhhh, " + str(roll) + "?")

@client.tree.command(
name = "dms",
description = "Disables direct messages from OtherDave, triggered by other users or otherwise."
Expand Down

0 comments on commit 8f5105d

Please sign in to comment.