Skip to content

Commit

Permalink
Update ver. 1.0.6 - Bugfix 2
Browse files Browse the repository at this point in the history
- Removed the following command: /[enable or disable] all_channels [True or False] and placed it in the new settings command.
- Added a settings command with a nice GUI, so you don't have to type in too many commands like toggling whether to enable or disable FixEmbed or choosing which services to convert.
- Fixed some things to help reliability with interactions in the settings menu
- Added a note to let the user know it make take some time to toggle the bot on and off in ALL channels
- Added a line to defer the interaction to improve responsiveness
  • Loading branch information
kenhendricks00 authored Jul 5, 2024
1 parent 1f4a120 commit 6f91258
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ async def callback(self, interaction: discord.Interaction):
embed = discord.Embed(
title="FixEmbed Settings",
description="**Enable/Disable FixEmbed:**\n"
f"{'🟢 FixEmbed enabled' if enabled else '🔴 FixEmbed disabled'}",
f"{'🟢 FixEmbed enabled' if enabled else '🔴 FixEmbed disabled'}\n\n"
"**NOTE:** May take a few seconds to apply changes to all channels.",
color=discord.Color.green()
if enabled else discord.Color.red())
view = FixEmbedSettingsView(enabled, self.interaction)
Expand Down Expand Up @@ -331,6 +332,9 @@ def __init__(self, enabled, interaction, timeout=180):
self.add_item(SettingsDropdown(interaction))

async def toggle(self, interaction: discord.Interaction):
# Acknowledge the interaction
await interaction.response.defer()

self.enabled = not self.enabled
for ch in self.interaction.guild.text_channels:
channel_states[ch.id] = self.enabled
Expand All @@ -343,7 +347,8 @@ async def toggle(self, interaction: discord.Interaction):
embed = discord.Embed(
title="FixEmbed Settings",
description="**Enable/Disable FixEmbed:**\n"
f"{'🟢 FixEmbed enabled' if self.enabled else '🔴 FixEmbed disabled'}",
f"{'🟢 FixEmbed enabled' if self.enabled else '🔴 FixEmbed disabled'}\n\n"
"**NOTE:** May take a few seconds to apply changes to all channels.",
color=discord.Color.green() if self.enabled else discord.Color.red())

try:
Expand Down

0 comments on commit 6f91258

Please sign in to comment.