From 51ceaba806b2eb5ebd3e66dabed792cb6456c8c9 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Tue, 19 Jul 2022 16:58:41 +0200 Subject: [PATCH] Made commands guild only --- src/modules/admin/command/restart_command.py | 1 + src/modules/admin/command/shutdown_command.py | 1 + src/modules/base/command/help_command.py | 1 + src/modules/base/command/info_command.py | 1 + src/modules/base/command/ping_command.py | 1 + 5 files changed, 5 insertions(+) diff --git a/src/modules/admin/command/restart_command.py b/src/modules/admin/command/restart_command.py index d2290b955e..e8de4f5b27 100644 --- a/src/modules/admin/command/restart_command.py +++ b/src/modules/admin/command/restart_command.py @@ -36,6 +36,7 @@ class RestartCommand(DiscordCommandABC): self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') @commands.command() + @commands.guild_only() async def restart(self, ctx: Context): self._logger.debug(__name__, f'Received command restart {ctx}') self._client_utils.received_command(ctx.guild.id) diff --git a/src/modules/admin/command/shutdown_command.py b/src/modules/admin/command/shutdown_command.py index 5f954127c7..f4e6849913 100644 --- a/src/modules/admin/command/shutdown_command.py +++ b/src/modules/admin/command/shutdown_command.py @@ -36,6 +36,7 @@ class ShutdownCommand(DiscordCommandABC): self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') @commands.command() + @commands.guild_only() async def shutdown(self, ctx: Context): self._logger.debug(__name__, f'Received command shutdown {ctx}') self._client_utils.received_command(ctx.guild.id) diff --git a/src/modules/base/command/help_command.py b/src/modules/base/command/help_command.py index b50d229d43..4bf9747178 100644 --- a/src/modules/base/command/help_command.py +++ b/src/modules/base/command/help_command.py @@ -31,6 +31,7 @@ class HelpCommand(DiscordCommandABC): self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') @commands.command() + @commands.guild_only() async def help(self, ctx: Context, persistent_flag: str = None): self._logger.debug(__name__, f'Received command help {ctx}:{persistent_flag}') self._client_utils.received_command(ctx.guild.id) diff --git a/src/modules/base/command/info_command.py b/src/modules/base/command/info_command.py index 6afb8671ea..d3c7de6575 100644 --- a/src/modules/base/command/info_command.py +++ b/src/modules/base/command/info_command.py @@ -37,6 +37,7 @@ class InfoCommand(DiscordCommandABC): self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') @commands.command() + @commands.guild_only() async def info(self, ctx: Context, *, wait: int = None): self._logger.debug(__name__, f'Received command info {ctx},{wait}') self._client_utils.received_command(ctx.guild.id) diff --git a/src/modules/base/command/ping_command.py b/src/modules/base/command/ping_command.py index 2df5fadaa3..f8a796ef28 100644 --- a/src/modules/base/command/ping_command.py +++ b/src/modules/base/command/ping_command.py @@ -30,6 +30,7 @@ class PingCommand(DiscordCommandABC): self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') @commands.command() + @commands.guild_only() async def ping(self, ctx: Context): self._logger.debug(__name__, f'Received command ping {ctx}') self._client_utils.received_command(ctx.guild.id)