From 3ce823f20955fd5ae6ee9c7b2545a61aa70656f2 Mon Sep 17 00:00:00 2001 From: stijndcl Date: Thu, 23 Jun 2022 11:09:43 +0200 Subject: [PATCH] Stash --- didier/cogs/owner.py | 8 ++++---- didier/data/modals/custom_commands.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/didier/cogs/owner.py b/didier/cogs/owner.py index 1e2d6b3..60fbe78 100644 --- a/didier/cogs/owner.py +++ b/didier/cogs/owner.py @@ -36,7 +36,7 @@ class Owner(commands.Cog): self.client.tree.copy_global_to(guild=guild) await self.client.tree.sync(guild=guild) else: - self.client.tree.clear_commands(guild=None) + # self.client.tree.clear_commands(guild=None) await self.client.tree.sync() await ctx.message.add_reaction("🔄") @@ -73,14 +73,14 @@ class Owner(commands.Cog): @add_slash.command(name="custom", description="Add a custom command") async def add_custom_slash(self, interaction: discord.Interaction): """Slash command to add a custom command""" - if not self.client.is_owner(interaction.user): + if not await self.client.is_owner(interaction.user): return interaction.response.send_message( "Je hebt geen toestemming om dit commando uit te voeren.", ephemeral=True ) - await interaction.response.defer(ephemeral=True) + # await interaction.response.defer(ephemeral=True) modal = CreateCustomCommand() - await interaction.response.send_message(modal) + await interaction.response.send_modal(modal) @commands.group(name="Edit") async def edit(self, ctx: commands.Context): diff --git a/didier/data/modals/custom_commands.py b/didier/data/modals/custom_commands.py index 18d9809..35f7f74 100644 --- a/didier/data/modals/custom_commands.py +++ b/didier/data/modals/custom_commands.py @@ -6,10 +6,10 @@ import discord class CreateCustomCommand(discord.ui.Modal, title="Custom Command"): """Modal shown to visually create custom commands""" - name: discord.ui.TextInput = discord.ui.TextInput(label="Name", placeholder="Name of the command...") + name: discord.ui.TextInput = discord.ui.TextInput(label="Name", placeholder="Name of the command") response: discord.ui.TextInput = discord.ui.TextInput( - label="Response", style=discord.TextStyle.long, placeholder="Response of the command...", max_length=2000 + label="Response", style=discord.TextStyle.long, placeholder="Response of the command", max_length=2000 ) async def on_submit(self, interaction: discord.Interaction) -> None: