Skip to content

Commit

Permalink
feat: add items to /config get
Browse files Browse the repository at this point in the history
  • Loading branch information
Skelmis committed Feb 25, 2024
1 parent 7f44e68 commit 3d78a1b
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
60 changes: 59 additions & 1 deletion suggestions/cogs/guild_config_cog.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,9 @@ async def get(
"Suggestions queue",
"Images in suggestions",
"Anonymous resolutions",
"Using physical queue",
"Queue channel",
"Queue rejection channel",
],
default=None,
),
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions suggestions/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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.",
Expand Down

0 comments on commit 3d78a1b

Please sign in to comment.