From 3d78a1bf3179440a4800055e6aa5172be13d94b8 Mon Sep 17 00:00:00 2001 From: skelmis Date: Sun, 25 Feb 2024 19:22:40 +1300 Subject: [PATCH] feat: add items to /config get --- suggestions/cogs/guild_config_cog.py | 60 +++++++++++++++++++++++++++- suggestions/locales/en_US.json | 6 +++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/suggestions/cogs/guild_config_cog.py b/suggestions/cogs/guild_config_cog.py index bc2373a..c55d0a2 100644 --- a/suggestions/cogs/guild_config_cog.py +++ b/suggestions/cogs/guild_config_cog.py @@ -192,6 +192,9 @@ async def get( "Suggestions queue", "Images in suggestions", "Anonymous resolutions", + "Using physical queue", + "Queue channel", + "Queue rejection channel", ], default=None, ), @@ -225,6 +228,33 @@ async def get( ) embed.description += log_channel + elif config == "Queue channel": + log_channel = ( + self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_LOG_CHANNEL_SET", interaction.locale + ).format(guild_config.queued_channel_id) + if guild_config.queued_channel_id + else self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_LOG_CHANNEL_NOT_SET", + interaction.locale, + ) + ) + embed.description += log_channel + + elif config == "Queue rejection channel": + log_channel = ( + self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_REJECTION_LOG_CHANNEL_SET", + interaction.locale, + ).format(guild_config.queued_log_channel_id) + if guild_config.queued_log_channel_id + else self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_REJECTION_LOG_CHANNEL_NOT_SET", + interaction.locale, + ) + ) + embed.description += log_channel + elif config == "Suggestions channel": suggestions_channel = ( self.bot.get_locale( @@ -378,6 +408,22 @@ async def send_full_config(self, interaction: disnake.GuildCommandInteraction): interaction.locale, ) ) + queue_channel = ( + f"<#{guild_config.queued_channel_id}>" + if guild_config.queued_channel_id + else self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_LOG_CHANNEL_NOT_SET", + interaction.locale, + ) + ) + queue_rejection_channel = ( + f"<#{guild_config.queued_log_channel_id}>" + if guild_config.queued_log_channel_id + else self.bot.get_locale( + "CONFIG_GET_INNER_PARTIAL_QUEUE_REJECTION_LOG_CHANNEL_NOT_SET", + interaction.locale, + ) + ) dm_responses = ( self.bot.get_locale( "CONFIG_GET_INNER_PARTIAL_DM_RESPONSES_NOT_SET", interaction.locale @@ -423,6 +469,16 @@ async def send_full_config(self, interaction: disnake.GuildCommandInteraction): "CONFIG_GET_INNER_ANONYMOUS_SUGGESTIONS_MESSAGE", interaction.locale ).format(anon_text) + physical_queue = ( + self.bot.get_locale( + "CONFIG_GET_INNER_USES_PHYSICAL_QUEUE_SET", interaction.locale + ) + if guild_config.virtual_suggestion_queue + else self.bot.get_locale( + "CONFIG_GET_INNER_USES_PHYSICAL_QUEUE_NOT_SET", interaction.locale + ) + ) + image_text = ( self.bot.get_locale( "CONFIG_GET_INNER_IMAGES_IN_SUGGESTIONS_SET", interaction.locale @@ -472,7 +528,9 @@ async def send_full_config(self, interaction: disnake.GuildCommandInteraction): f"Log channel: {log_channel}\nDm responses: I {dm_responses} DM users on actions such as suggest\n" f"Suggestion threads: {threads}\nKeep Logs: {keep_logs}\nAnonymous suggestions: {anon}\n" f"Automatic thread archiving: {auto_archive_threads}\nSuggestions queue: {suggestions_queue}\n" - f"Images in suggestions: {images}\nAnonymous resolutions: {anonymous_resolutions}", + f"Physical queue: {physical_queue}\nImages in suggestions: {images}\n" + f"Anonymous resolutions: {anonymous_resolutions}\n" + f"Queue channel: {queue_channel}\nQueue rejection channel: {queue_rejection_channel}", color=self.bot.colors.embed_color, timestamp=self.bot.state.now, ).set_author(name=guild.name, icon_url=icon_url) diff --git a/suggestions/locales/en_US.json b/suggestions/locales/en_US.json index 9a92945..02b2912 100644 --- a/suggestions/locales/en_US.json +++ b/suggestions/locales/en_US.json @@ -68,6 +68,10 @@ "CONFIG_GET_INNER_BASE_EMBED_DESCRIPTION": "Configuration for {}\n", "CONFIG_GET_INNER_PARTIAL_LOG_CHANNEL_SET": "Log channel: <#{}>", "CONFIG_GET_INNER_PARTIAL_LOG_CHANNEL_NOT_SET": "Not set", + "CONFIG_GET_INNER_PARTIAL_QUEUE_LOG_CHANNEL_SET": "Queue channel: <#{}>", + "CONFIG_GET_INNER_PARTIAL_QUEUE_LOG_CHANNEL_NOT_SET": "Not set", + "CONFIG_GET_INNER_PARTIAL_QUEUE_REJECTION_LOG_CHANNEL_SET": "Queue rejection channel: <#{}>", + "CONFIG_GET_INNER_PARTIAL_QUEUE_REJECTION_LOG_CHANNEL_NOT_SET": "Not set", "CONFIG_GET_INNER_PARTIAL_SUGGESTION_CHANNEL_SET": "Suggestion channel: <#{}>", "CONFIG_GET_INNER_PARTIAL_SUGGESTION_CHANNEL_NOT_SET": "Not set", "CONFIG_GET_INNER_PARTIAL_DM_RESPONSES_SET": "will", @@ -81,6 +85,8 @@ "CONFIG_GET_INNER_ANONYMOUS_SUGGESTIONS_SET": "can", "CONFIG_GET_INNER_ANONYMOUS_SUGGESTIONS_NOT_SET": "cannot", "CONFIG_GET_INNER_ANONYMOUS_SUGGESTIONS_MESSAGE": "This guild {} have anonymous suggestions.", + "CONFIG_GET_INNER_USES_PHYSICAL_QUEUE_SET": "This guild uses a virtual suggestions queue.", + "CONFIG_GET_INNER_USES_PHYSICAL_QUEUE_NOT_SET": "This guild uses a physical suggestions queue.", "CONFIG_GET_INNER_AUTO_ARCHIVE_THREADS_SET": "will", "CONFIG_GET_INNER_AUTO_ARCHIVE_THREADS_NOT_SET": "will not", "CONFIG_GET_INNER_AUTO_ARCHIVE_THREADS_MESSAGE": "I {} automatically archive threads created for suggestions.",