Attempting to make set channel behavior be nice

This commit is contained in:
AllfatherHatt 2025-05-18 13:18:50 +02:00
parent 1a390c3d25
commit 88ecf7911f

View File

@ -109,27 +109,17 @@ class Recruitment(commands.Cog): # noqa
self.cog_check_enabled = not self.cog_check_enabled self.cog_check_enabled = not self.cog_check_enabled
await ctx.send(f"Cog checks are now {'enabled' if self.cog_check_enabled else 'disabled'}.") await ctx.send(f"Cog checks are now {'enabled' if self.cog_check_enabled else 'disabled'}.")
@commands.guild_only() @commands.group(name="setapplicationschannel", invoke_without_command=True)
@checks.admin_or_permissions(manage_guild=True) @checks.admin_or_permissions(manage_guild=True)
@commands.group( async def set_applications_channel(self, ctx: commands.Context, channel: discord.TextChannel = None):
name="setapplicationschannel",
invoke_without_command=True,
)
@commands.command(name="setapplicationschannel")
@checks.admin_or_permissions(manage_guild=True)
async def set_applications_channel(
self, ctx: commands.Context, channel: discord.TextChannel = None
) -> None:
"""Set the channel where applications will be sent.""" """Set the channel where applications will be sent."""
# if no channel was passed, default to the one you ran it in
channel = channel or ctx.channel channel = channel or ctx.channel
await self.config.guild(ctx.guild).application_channel_id.set(channel.id) await self.config.guild(ctx.guild).application_channel_id.set(channel.id)
await ctx.send(f"Application channel set to {channel.mention}.") await ctx.send(f"Application channel set to {channel.mention}.")
@set_applications_channel.command(name="clear") @set_applications_channel.command(name="clear")
async def clear_applications_channel(self, ctx: commands.Context) -> None: async def clear_applications_channel(self, ctx: commands.Context):
"""Clear the current application channel.""" """Clear the application channel."""
await self.config.guild(ctx.guild).clear_raw("application_channel_id") await self.config.guild(ctx.guild).clear_raw("application_channel_id")
await ctx.send("Application channel cleared.") await ctx.send("Application channel cleared.")