Skip to content

Commit

Permalink
fix(commands): Resolve hybrid commands not displaying slash commands (#…
Browse files Browse the repository at this point in the history
…26)

Co-authored-by: Alc-Alc <alc@localhost>
  • Loading branch information
Alc-Alc and Alc-Alc committed Nov 20, 2023
1 parent 2be3030 commit ae4ec60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/byte/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ def __init__(self, command_prefix: list[str], intents: Intents, activity: Activi

async def setup_hook(self) -> None:
"""Any setup we need can be here."""
# Load cogs before syncing the tree.
await self.load_cogs()
dev_guild = discord.Object(id=settings.discord.DEV_GUILD_ID)
self.tree.copy_global_to(guild=dev_guild)
await self.tree.sync(guild=dev_guild)
await self.load_cogs()

async def load_cogs(self) -> None:
"""Load cogs."""
Expand Down
6 changes: 5 additions & 1 deletion src/byte/plugins/events.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Plugins for events."""
from threading import Thread
from typing import cast

from discord import Embed
from discord.ext.commands import Bot, Cog
Expand Down Expand Up @@ -33,7 +34,10 @@ async def on_thread_create(self, thread: Thread) -> None:
embed.add_field(
name="No Response?", value="If no response in a reasonable time, ping @Member.", inline=True
)
embed.add_field(name="Closing", value=f"To close, type `{self.bot.command_prefix}solve`.", inline=True)
commands_to_solve = " or ".join(
f"`{command_prefix}solve`" for command_prefix in cast(list[str], self.bot.command_prefix)
)
embed.add_field(name="Closing", value=f"To close, type {commands_to_solve}.", inline=True)
embed.add_field(name="MCVE", value=f"Please include an [MCVE](<{mcve}>) if relevant.", inline=False)
embed.set_thumbnail(url=litestar_logo_yellow)
view = HelpThreadView(author=thread.owner, bot=self.bot)
Expand Down

0 comments on commit ae4ec60

Please sign in to comment.