|
|
@@ -16,7 +16,7 @@ class Matesearch(commands.Cog):
|
|
|
self.bot = bot
|
|
|
|
|
|
#Modal form layout
|
|
|
- self.add_item(discord.ui.InputText(label="Date", placeholder="Insert the estimated date..", required=False, ))
|
|
|
+ self.add_item(discord.ui.InputText(label="Date", placeholder="Insert the estimated date.", required=False, ))
|
|
|
self.add_item(discord.ui.InputText(label="Time", placeholder="Insert the estimated time."))
|
|
|
|
|
|
#funktions to load the config and get the channels
|
|
|
@@ -40,7 +40,7 @@ class Matesearch(commands.Cog):
|
|
|
if search_role is None:
|
|
|
print(f"Log channel with ID {search_role_id} not found.")
|
|
|
return None
|
|
|
- return role_channel
|
|
|
+ return search_role
|
|
|
|
|
|
|
|
|
#Output of the Modal form
|
|
|
@@ -50,7 +50,7 @@ class Matesearch(commands.Cog):
|
|
|
embed.add_field(name="Ersteller", value=interaction.user.mention, inline=False)
|
|
|
embed.add_field(name="Datum", value=self.children[0].value, inline=False)
|
|
|
embed.add_field(name="Zeit", value=self.children[1].value, inline=False)
|
|
|
- embed.add_field(value=_get_role(), inline=False)
|
|
|
+ embed.add_field(value=self.get_role(), inline=False)
|
|
|
self.embed = embed
|
|
|
|
|
|
#sending the embed
|
|
|
@@ -60,17 +60,17 @@ class Matesearch(commands.Cog):
|
|
|
|
|
|
#Slash command to trigger the Modal form
|
|
|
@slash_command()
|
|
|
- async def search(self, ctx: discord.ApplicationContext):
|
|
|
+ async def mitspielergesucht(self, ctx: discord.ApplicationContext):
|
|
|
"""Start a search for players."""
|
|
|
|
|
|
## Only be able to send if last request is min 20h old
|
|
|
|
|
|
- config = _load_config()
|
|
|
+ config = self.Form._load_config()
|
|
|
enable_search = config.getboolean("Matesearch","enable_search_mates")
|
|
|
if not enable_search:
|
|
|
return
|
|
|
|
|
|
- modal = self.Situ(self.bot, title="Fill the form to search for players.") # type: ignore
|
|
|
+ modal = self.Form(self.bot, title="Fill the form to search for players.") # type: ignore
|
|
|
await ctx.send_modal(modal)
|
|
|
|
|
|
|