mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-22 02:37:57 -05:00
License info command (#3090)
* Adds a licenseinfo command * good enough for now * changelog * *sigh* Fine, have it your way Draper * thanks Flame
This commit is contained in:
@@ -1136,7 +1136,7 @@ class Core(commands.Cog, CoreLogic):
|
||||
@checks.is_owner()
|
||||
async def api(self, ctx: commands.Context, service: str, *, tokens: TokenConverter):
|
||||
"""Set various external API tokens.
|
||||
|
||||
|
||||
This setting will be asked for by some 3rd party cogs and some core cogs.
|
||||
|
||||
To add the keys provide the service name and the tokens as a comma separated
|
||||
@@ -1162,7 +1162,7 @@ class Core(commands.Cog, CoreLogic):
|
||||
Allows the help command to be sent as a paginated menu instead of seperate
|
||||
messages.
|
||||
|
||||
This defaults to False.
|
||||
This defaults to False.
|
||||
Using this without a setting will toggle.
|
||||
"""
|
||||
if use_menus is None:
|
||||
@@ -1907,6 +1907,12 @@ class Core(commands.Cog, CoreLogic):
|
||||
)
|
||||
return
|
||||
|
||||
if isinstance(command_obj, commands.commands._AlwaysAvailableCommand):
|
||||
await ctx.send(
|
||||
_("This command is designated as being always available and cannot be disabled.")
|
||||
)
|
||||
return
|
||||
|
||||
async with ctx.bot._config.disabled_commands() as disabled_commands:
|
||||
if command not in disabled_commands:
|
||||
disabled_commands.append(command_obj.qualified_name)
|
||||
@@ -1935,6 +1941,12 @@ class Core(commands.Cog, CoreLogic):
|
||||
)
|
||||
return
|
||||
|
||||
if isinstance(command_obj, commands.commands._AlwaysAvailableCommand):
|
||||
await ctx.send(
|
||||
_("This command is designated as being always available and cannot be disabled.")
|
||||
)
|
||||
return
|
||||
|
||||
if command_obj.requires.privilege_level > await PrivilegeLevel.from_ctx(ctx):
|
||||
await ctx.send(_("You are not allowed to disable that command."))
|
||||
return
|
||||
@@ -2215,3 +2227,21 @@ class Core(commands.Cog, CoreLogic):
|
||||
async def rpc_reload(self, request):
|
||||
await self.rpc_unload(request)
|
||||
await self.rpc_load(request)
|
||||
|
||||
|
||||
# Removing this command from forks is a violation of the GPLv3 under which it is licensed.
|
||||
# Otherwise interfering with the ability for this command to be accessible is also a violation.
|
||||
@commands.command(cls=commands.commands._AlwaysAvailableCommand, name="licenseinfo", i18n=_)
|
||||
async def license_info_command(ctx):
|
||||
"""
|
||||
Get info about Red's licenses
|
||||
"""
|
||||
|
||||
message = (
|
||||
"This bot is an instance of Red-DiscordBot (hereafter refered to as Red)\n"
|
||||
"Red is a free and open source application made available to the public and "
|
||||
"licensed under the GNU GPLv3. The full text of this license is available to you at "
|
||||
"<https://github.com/Cog-Creators/Red-DiscordBot/blob/V3/develop/LICENSE>"
|
||||
)
|
||||
await ctx.send(message)
|
||||
# We need a link which contains a thank you to other projects which we use at some point.
|
||||
|
||||
Reference in New Issue
Block a user