Implemented /stage edit and /stage delete (#2)

This commit is contained in:
2025-04-22 22:36:43 +02:00
parent f2c81648fa
commit ec094f9a98
7 changed files with 183 additions and 37 deletions

View File

@@ -15,7 +15,7 @@ from discord.utils import basic_autocomplete
from classes import PycordEvent, PycordGuild
from classes.pycord_bot import PycordBot
from modules.database import col_events
from modules.utils import autofill_active_events
from modules.utils import autocomplete_active_events
# TODO Move to staticmethod or to a separate module
@@ -120,7 +120,7 @@ class Event(Cog):
@option(
"event",
description="Name of the event",
autocomplete=basic_autocomplete(autofill_active_events),
autocomplete=basic_autocomplete(autocomplete_active_events),
required=True,
)
@option("name", description="New name of the event", required=False)
@@ -192,14 +192,21 @@ class Event(Cog):
@option(
"event",
description="Name of the event",
autocomplete=basic_autocomplete(autofill_active_events),
autocomplete=basic_autocomplete(autocomplete_active_events),
required=True,
)
@option("confirm", description="Confirmation of the operation", required=False)
async def command_event_cancel(
self,
ctx: ApplicationContext,
event: str,
confirm: bool = False,
) -> None:
if confirm is None or not confirm:
# TODO Make a nice message
await ctx.respond("Operation not confirmed.")
return
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
pycord_event: PycordEvent = await self.bot.find_event(event_id=event)
@@ -239,7 +246,7 @@ class Event(Cog):
@option(
"event",
description="Name of the event",
autocomplete=basic_autocomplete(autofill_active_events),
autocomplete=basic_autocomplete(autocomplete_active_events),
required=True,
)
async def command_event_show(self, ctx: ApplicationContext, event: str) -> None: