✨
This commit is contained in:
@ -2,12 +2,18 @@ import datetime # Used in hello_func
|
||||
|
||||
from interactions import SlashContext, Embed, SlashCommand
|
||||
|
||||
from .name_generator import NameGenerator
|
||||
|
||||
from .roll import DieRoller
|
||||
|
||||
def gen_help_text(commands: list[SlashCommand]):
|
||||
return '\n'.join([f"`/{i.name}`\t— {i.description}" for i in commands])
|
||||
|
||||
class Other():
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
self._name_generator = NameGenerator()
|
||||
self._roller = DieRoller()
|
||||
|
||||
# Responds with a greeting of a time-appropriate maner
|
||||
async def hello_func(self, ctx: SlashContext):
|
||||
@ -48,3 +54,12 @@ class Other():
|
||||
except:
|
||||
await ctx.send(f"Could not find a help file for the command '/{command}'")
|
||||
|
||||
async def generate_name(self, ctx: SlashContext):
|
||||
await ctx.send(self._name_generator.generate())
|
||||
|
||||
async def roll_dice(self, ctx: SlashContext, dice: str):
|
||||
try:
|
||||
roll = self._roller.roll(dice)
|
||||
await ctx.send(f":game_die:Rolling dice `{dice}`\n{roll}")
|
||||
except:
|
||||
await ctx.send("There was an error in the rolling")
|
||||
|
Reference in New Issue
Block a user