Made commands guild only

This commit is contained in:
Sven Heidemann 2022-07-19 16:58:41 +02:00
parent 0d8a4f8ae6
commit 51ceaba806
5 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ class RestartCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command() @commands.command()
@commands.guild_only()
async def restart(self, ctx: Context): async def restart(self, ctx: Context):
self._logger.debug(__name__, f'Received command restart {ctx}') self._logger.debug(__name__, f'Received command restart {ctx}')
self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id)

View File

@ -36,6 +36,7 @@ class ShutdownCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command() @commands.command()
@commands.guild_only()
async def shutdown(self, ctx: Context): async def shutdown(self, ctx: Context):
self._logger.debug(__name__, f'Received command shutdown {ctx}') self._logger.debug(__name__, f'Received command shutdown {ctx}')
self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id)

View File

@ -31,6 +31,7 @@ class HelpCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command() @commands.command()
@commands.guild_only()
async def help(self, ctx: Context, persistent_flag: str = None): async def help(self, ctx: Context, persistent_flag: str = None):
self._logger.debug(__name__, f'Received command help {ctx}:{persistent_flag}') self._logger.debug(__name__, f'Received command help {ctx}:{persistent_flag}')
self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id)

View File

@ -37,6 +37,7 @@ class InfoCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command() @commands.command()
@commands.guild_only()
async def info(self, ctx: Context, *, wait: int = None): async def info(self, ctx: Context, *, wait: int = None):
self._logger.debug(__name__, f'Received command info {ctx},{wait}') self._logger.debug(__name__, f'Received command info {ctx},{wait}')
self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id)

View File

@ -30,6 +30,7 @@ class PingCommand(DiscordCommandABC):
self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}') self._logger.trace(__name__, f'Loaded command service: {type(self).__name__}')
@commands.command() @commands.command()
@commands.guild_only()
async def ping(self, ctx: Context): async def ping(self, ctx: Context):
self._logger.debug(__name__, f'Received command ping {ctx}') self._logger.debug(__name__, f'Received command ping {ctx}')
self._client_utils.received_command(ctx.guild.id) self._client_utils.received_command(ctx.guild.id)