diff --git a/src/extensions/rss.py b/src/extensions/cmds.py similarity index 87% rename from src/extensions/rss.py rename to src/extensions/cmds.py index e100ee7..d64a941 100644 --- a/src/extensions/rss.py +++ b/src/extensions/cmds.py @@ -16,7 +16,7 @@ from discord.app_commands import Choice, Group, autocomplete, rename, command from discord.errors import Forbidden from api import API -from feed import Subscription, SubscriptionChannel, TrackedContent +from feed import Subscription, TrackedContent from utils import ( Followup, PaginationView, @@ -79,7 +79,7 @@ async def validate_rss_source(nickname: str, url: str) -> Tuple[str | None, Feed return None, feed -class FeedCog(commands.Cog): +class CommandsCog(commands.Cog): """ Command cog. """ @@ -94,8 +94,15 @@ class FeedCog(commands.Cog): log.info("%s cog is ready", self.__class__.__name__) - @command(name="subscriptions") - async def list_subscription(self, inter: Interaction): + # Group for commands about viewing data + view_group = Group( + name="view", + description="View data.", + guild_only=True + ) + + @view_group.command(name="subscriptions") + async def cmd_list_subs(self, inter: Interaction): """List Subscriptions from this server.""" await inter.response.defer() @@ -133,9 +140,19 @@ class FeedCog(commands.Cog): initpage=1 ) await pagination.send() - # await Followup("results", str(await getdata(1, 10))).send(inter) - @command(name="test-channel-permissions") + @view_group.command(name="tracked-content") + async def cmd_list_tracked(self, inter: Interaction): + """List Tracked Content from this server, or a given sub""" + + # Group for test related commands + test_group = Group( + name="test", + description="Commands to test Bot functionality.", + guild_only=True + ) + + @test_group.command(name="channel-permissions") async def cmd_test_channel_perms(self, inter: Interaction): """Test that the current channel's permissions allow for PYRSS to operate in it.""" @@ -174,9 +191,9 @@ class FeedCog(commands.Cog): async def setup(bot): """ Setup function for this extension. - Adds `FeedCog` to the bot. + Adds `CommandsCog` to the bot. """ - cog = FeedCog(bot) + cog = CommandsCog(bot) await bot.add_cog(cog) log.info("Added %s cog", cog.__class__.__name__)