diff --git a/extensions/links.py b/extensions/links.py index bf20fd0b3acc93f575b4c7978fd810f5d1b57092..a3fb160bbc3d46efe4bfb93ca9175677756644a5 100644 --- a/extensions/links.py +++ b/extensions/links.py @@ -22,7 +22,8 @@ class Links(commands.GroupCog, name="links", description="Linkverwaltung für Ka json.dump(self.links, links_file) @app_commands.command(name="list", description="Liste Links für diesen Kanal auf.") - @app_commands.describe(topic="Zeige nur Links für dieses Thema an.", public="Zeige die Linkliste für alle.") + @app_commands.describe(topic="Zeige nur Links für dieses Thema an.", + public="Zeige die Ausgabe des Commands öffentlich, für alle Mitglieder sichtbar.") async def cmd_list(self, interaction: Interaction, topic: str = None, public: bool = False): await interaction.response.defer(ephemeral=not public) diff --git a/extensions/module_information.py b/extensions/module_information.py index 00143316bdd01674dfd5bb53f2dbe38f3ca0f59c..2be073a26972961a1e5e5c8494d5795efa45b30d 100644 --- a/extensions/module_information.py +++ b/extensions/module_information.py @@ -314,7 +314,7 @@ class ModuleInformation(commands.Cog): @app_commands.command(name="module", description="Erhalte Informationen zu einem Kurs/Modul, abhängig von deinem Studiengang") - @app_commands.describe(public="Zeige die Modulinformationen öffentlich, oder nicht.", + @app_commands.describe(public="Zeige die Ausgabe des Commands öffentlich, für alle Mitglieder sichtbar.", topic="Welche speziellen Informationen interessieren dich?", stg="Der Studiengang, für den die Informationen angezeigt werden sollen.") async def cmd_module(self, interaction: Interaction, public: bool, topic: Topics = None, @@ -323,7 +323,7 @@ class ModuleInformation(commands.Cog): if topic == Topics.handbuch: await self.execute_subcommand(interaction, stg, self.handbook) - elif topic == Topics.probe: + elif topic == Topics.leseprobe: await self.execute_subcommand(interaction, stg, self.reading_sample) elif topic == Topics.aufwand: await self.execute_subcommand(interaction, stg, self.load) diff --git a/extensions/text_commands.py b/extensions/text_commands.py index fc8fd68c07cc40f5119c890d1a26f0ad499a754d..e8f073800ceea645043ef84c280800feb0c656df 100644 --- a/extensions/text_commands.py +++ b/extensions/text_commands.py @@ -129,24 +129,31 @@ class TextCommands(commands.GroupCog, name="commands", description="Text Command "Texte zu diesem Command ausgeben lassen.\n\n_" for command in commands: text_command = self.text_commands.get(command.name) + command_msg = "" if command.default_permissions and interaction.permissions.value & command.default_permissions.value == 0: continue if isinstance(command, Group): - msg += f"**{command.name}**: *{command.description}*\n" + command_msg += f"**{command.name}**: *{command.description}*\n" for c in command.commands: - msg += f" `/{command.name} {c.name}`: *{c.description}*\n" - msg += "\n" + command_msg += f" `/{command.name} {c.name}`: *{c.description}*\n" + command_msg += "\n" else: if text_command: - msg += f"`/{command.name}`\*: *{command.description}*\n" + command_msg += f"`/{command.name}`\*: *{command.description}*\n" if cmd: for i, text in enumerate(text_command["data"]): - msg += f"`{i}`: {text}\n" + command_msg += f"`{i}`: {text}\n" else: - msg += f"`/{command.name}`: *{command.description}*\n" - msg += "\n" + command_msg += f"`/{command.name}`: *{command.description}*\n" + command_msg += "\n" - await interaction.edit_original_response(content=msg) + if len(msg + command_msg) > utils.MAX_MESSAGE_LEN: + await interaction.followup.send(content=msg, ephemeral=True) + msg = command_msg + else: + msg += command_msg + + await interaction.followup.send(content=msg, ephemeral=True) async def add_command(self, cmd: str, text: str, description: str, guild_id: int): mod_channel = await self.bot.fetch_channel(self.mod_channel_id) diff --git a/fernuni_bot.py b/fernuni_bot.py index 58d4a8cbefb6782fc791fa984fef7de0fca6f3c4..43c40a6b52c68082df035c9c0dc2f57bc3515b09 100644 --- a/fernuni_bot.py +++ b/fernuni_bot.py @@ -57,11 +57,6 @@ bot = Boty(command_prefix='!', help_command=None, activity=Game(ACTIVITY), owner initial_extensions=extensions) -# bot.add_cog(ChangeLogCog(bot)) - -# SlashClient(bot, show_warnings=True) # Stellt den Zugriff auf die Buttons bereit - - def get_reaction(reactions): """ Returns the reaction, that is equal to the specified PIN_EMOJI, or if that reaction does not exist in list of reactions, None will be returned""" diff --git a/utils.py b/utils.py index a602e88998185c9422984bffa6a1bb18d0e844ef..3ff1b97ab70f64ad8b09377d9e4c410b99e6e3a9 100644 --- a/utils.py +++ b/utils.py @@ -10,7 +10,7 @@ from views.dialog_view import DialogView load_dotenv() DATE_TIME_FMT = os.getenv("DISCORD_DATE_TIME_FORMAT") - +MAX_MESSAGE_LEN = 2000 async def send_dm(user, message, embed=None): """ Send DM to a user/member """