Set commands to be dm or guild only

This commit is contained in:
Marc Di Luzio 2024-08-09 00:32:59 +01:00
parent f082b9df42
commit b6a4bdf46c

View file

@ -34,6 +34,7 @@ async def on_ready():
@bot.command() @bot.command()
@commands.check(lambda ctx: ctx.message.author.id in config.OWNERS) @commands.check(lambda ctx: ctx.message.author.id in config.OWNERS)
@commands.dm_only()
async def sync(ctx: discord.ext.commands.context.Context): async def sync(ctx: discord.ext.commands.context.Context):
"""Handle sync command""" """Handle sync command"""
# Sync the commands with the discord API # Sync the commands with the discord API
@ -46,6 +47,7 @@ async def sync(ctx: discord.ext.commands.context.Context):
@bot.tree.command(description = "Match matchees into groups", guilds = list(g for g in guilds if g.id in config.SERVERS)) @bot.tree.command(description = "Match matchees into groups", guilds = list(g for g in guilds if g.id in config.SERVERS))
@app_commands.describe(per_group = "Matchees per group (default 3+)", post = "Post to channel") @app_commands.describe(per_group = "Matchees per group (default 3+)", post = "Post to channel")
@commands.guild_only()
async def match(interaction: discord.Interaction, per_group: int = None, post: bool = None): async def match(interaction: discord.Interaction, per_group: int = None, post: bool = None):
"""Match groups of channel members""" """Match groups of channel members"""
if not per_group: if not per_group: