1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00

chore: Update usage generation for fun commands

This commit is contained in:
wlinator 2024-09-07 08:09:50 -04:00
parent 4f0c57f975
commit 8fee6c4113
2 changed files with 11 additions and 9 deletions

View file

@ -4,16 +4,21 @@ from discord.ext import commands
from tux.bot import Tux
from tux.ui.embeds import EmbedCreator
from tux.utils.flags import generate_usage
class Random(commands.Cog):
def __init__(self, bot: Tux) -> None:
self.bot = bot
self.random.usage = generate_usage(self.random)
self.coinflip.usage = generate_usage(self.coinflip)
self.eight_ball.usage = generate_usage(self.eight_ball)
self.dice.usage = generate_usage(self.dice)
self.random_number.usage = generate_usage(self.random_number)
@commands.hybrid_group(
name="random",
aliases=["rand"],
usage="random <subcommand>",
)
@commands.guild_only()
async def random(self, ctx: commands.Context[Tux]) -> None:
@ -31,7 +36,6 @@ class Random(commands.Cog):
@random.command(
name="coinflip",
aliases=["cf"],
usage="random coinflip",
)
@commands.guild_only()
async def coinflip(self, ctx: commands.Context[Tux]) -> None:
@ -51,7 +55,6 @@ class Random(commands.Cog):
@random.command(
name="8ball",
aliases=["eightball", "8b"],
usage="random 8ball [question]",
)
@commands.guild_only()
async def eight_ball(self, ctx: commands.Context[Tux], *, question: str, cow: bool = False) -> None:
@ -155,7 +158,6 @@ class Random(commands.Cog):
@random.command(
name="dice",
aliases=["d"],
usage="random dice <sides>",
)
@commands.guild_only()
async def dice(self, ctx: commands.Context[Tux], sides: int = 6) -> None:
@ -188,7 +190,6 @@ class Random(commands.Cog):
@random.command(
name="number",
aliases=["n"],
usage="random number <min> <max>",
)
@commands.guild_only()
async def random_number(

View file

@ -5,6 +5,7 @@ from loguru import logger
from tux.bot import Tux
from tux.ui.buttons import XkcdButtons
from tux.ui.embeds import EmbedCreator
from tux.utils.flags import generate_usage
from tux.wrappers import xkcd
@ -12,11 +13,14 @@ class Xkcd(commands.Cog):
def __init__(self, bot: Tux) -> None:
self.bot = bot
self.client = xkcd.Client()
self.xkcd.usage = generate_usage(self.xkcd)
self.latest.usage = generate_usage(self.latest)
self.random.usage = generate_usage(self.random)
self.specific.usage = generate_usage(self.specific)
@commands.hybrid_group(
name="xkcd",
aliases=["xk"],
usage="xkcd <subcommand>",
)
@commands.guild_only()
async def xkcd(self, ctx: commands.Context[Tux], comic_id: int | None = None) -> None:
@ -39,7 +43,6 @@ class Xkcd(commands.Cog):
@xkcd.command(
name="latest",
aliases=["l", "new", "n"],
usage="xkcd latest",
)
@commands.guild_only()
async def latest(self, ctx: commands.Context[Tux]) -> None:
@ -62,7 +65,6 @@ class Xkcd(commands.Cog):
@xkcd.command(
name="random",
aliases=["rand", "r"],
usage="xkcd random",
)
@commands.guild_only()
async def random(self, ctx: commands.Context[Tux]) -> None:
@ -85,7 +87,6 @@ class Xkcd(commands.Cog):
@xkcd.command(
name="specific",
aliases=["s", "id", "num"],
usage="xkcd specific [comic_id]",
)
@commands.guild_only()
async def specific(self, ctx: commands.Context[Tux], comic_id: int) -> None: