From 69b2b5e4edf7535c6028dcc0d4ead01d6099d58c Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 12 Nov 2020 14:45:15 -0500 Subject: [PATCH 01/22] Core guide initial commit --- docs/cog_guides/core.rst | 2519 ++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + 2 files changed, 2520 insertions(+) create mode 100644 docs/cog_guides/core.rst diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst new file mode 100644 index 000000000..76666056d --- /dev/null +++ b/docs/cog_guides/core.rst @@ -0,0 +1,2519 @@ +.. _core: + +==== +Core +==== + +This is the cog guide for the core cog. You will +find detailed docs about usage and commands. + +``[p]`` is considered as your prefix. + +.. note:: To use this cog, load it by typing this:: + + [p]load core + +.. _core-usage: + +----- +Usage +----- + +Commands related to core functions. + + +.. _core-commands: + +-------- +Commands +-------- + +.. _core-command-allowlist: + +^^^^^^^^^ +allowlist +^^^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]allowlist + +.. tip:: Alias: ``whitelist`` + +**Description** + +Allowlist management commands. + +.. _core-command-allowlist-add: + +""""""""""""" +allowlist add +""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]allowlist add ... + +**Description** + +Adds a user to the allowlist. + +.. _core-command-allowlist-clear: + +""""""""""""""" +allowlist clear +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]allowlist clear + +**Description** + +Clears the allowlist. + +.. _core-command-allowlist-list: + +"""""""""""""" +allowlist list +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]allowlist list + +**Description** + +Lists users on the allowlist. + +.. _core-command-allowlist-remove: + +"""""""""""""""" +allowlist remove +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]allowlist remove ... + +**Description** + +Removes user from the allowlist. + +.. _core-command-autoimmune: + +^^^^^^^^^^ +autoimmune +^^^^^^^^^^ + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]autoimmune + +**Description** + +Server settings for immunity from automated actions. + +.. _core-command-autoimmune-add: + +"""""""""""""" +autoimmune add +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]autoimmune add + +**Description** + +Makes a user or role immune from automated moderation actions. + +.. _core-command-autoimmune-isimmune: + +""""""""""""""""""" +autoimmune isimmune +""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]autoimmune isimmune + +**Description** + +Checks if a user or role would be considered immune from automated actions. + +.. _core-command-autoimmune-list: + +""""""""""""""" +autoimmune list +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]autoimmune list + +**Description** + +Gets the current members and roles configured for automatic +moderation action immunity. + +.. _core-command-autoimmune-remove: + +""""""""""""""""" +autoimmune remove +""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]autoimmune remove + +**Description** + +Makes a user or role immune from automated moderation actions. + +.. _core-command-blocklist: + +^^^^^^^^^ +blocklist +^^^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]blocklist + +.. tip:: Aliases: ``blacklist``, ``denylist`` + +**Description** + +Blocklist management commands. + +.. _core-command-blocklist-add: + +""""""""""""" +blocklist add +""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]blocklist add ... + +**Description** + +Adds a user to the blocklist. + +.. _core-command-blocklist-clear: + +""""""""""""""" +blocklist clear +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]blocklist clear + +**Description** + +Clears the blocklist. + +.. _core-command-blocklist-list: + +"""""""""""""" +blocklist list +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]blocklist list + +**Description** + +Lists users on the blocklist. + +.. _core-command-blocklist-remove: + +"""""""""""""""" +blocklist remove +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]blocklist remove ... + +**Description** + +Removes user from the blocklist. + +.. _core-command-command: + +^^^^^^^ +command +^^^^^^^ + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]command + +**Description** + +Manage the bot's commands and cogs. + +.. _core-command-command-defaultdisablecog: + +""""""""""""""""""""""""" +command defaultdisablecog +""""""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]command defaultdisablecog + +**Description** + +Set the default state for a cog as disabled. + +.. _core-command-command-defaultenablecog: + +"""""""""""""""""""""""" +command defaultenablecog +"""""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]command defaultenablecog + +**Description** + +Set the default state for a cog as enabled. + +.. _core-command-command-disable: + +""""""""""""""" +command disable +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command disable + +**Description** + +Disable a command. + +If you're the bot owner, this will disable commands +globally by default. + +.. _core-command-command-disable-global: + +"""""""""""""""""""""" +command disable global +"""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]command disable global + +**Description** + +Disable a command globally. + +.. _core-command-command-disable-server: + +"""""""""""""""""""""" +command disable server +"""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command disable server + +.. tip:: Alias: ``command disable guild`` + +**Description** + +Disable a command in this server only. + +.. _core-command-command-disablecog: + +"""""""""""""""""" +command disablecog +"""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command disablecog + +**Description** + +Disable a cog in this guild. + +.. _core-command-command-disabledmsg: + +""""""""""""""""""" +command disabledmsg +""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]command disabledmsg [message] + +**Description** + +Set the bot's response to disabled commands. + +Leave blank to send nothing. + +To include the command name in the message, include the +``{command}`` placeholder. + +.. _core-command-command-enable: + +"""""""""""""" +command enable +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command enable + +**Description** + +Enable a command. + +If you're a bot owner, this will try to enable a globally +disabled command by default. + +.. _core-command-command-enable-global: + +""""""""""""""""""""" +command enable global +""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]command enable global + +**Description** + +Enable a command globally. + +.. _core-command-command-enable-server: + +""""""""""""""""""""" +command enable server +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command enable server + +.. tip:: Alias: ``command enable guild`` + +**Description** + +Enable a command in this server. + +.. _core-command-command-enablecog: + +""""""""""""""""" +command enablecog +""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command enablecog + +**Description** + +Enable a cog in this guild. + +.. _core-command-command-listdisabled: + +"""""""""""""""""""" +command listdisabled +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command listdisabled + +**Description** + +List disabled commands. + +If you're the bot owner, this will show global disabled commands by default. + +.. _core-command-command-listdisabled-global: + +""""""""""""""""""""""""""" +command listdisabled global +""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command listdisabled global + +**Description** + +List disabled commands globally. + +.. _core-command-command-listdisabled-guild: + +"""""""""""""""""""""""""" +command listdisabled guild +"""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command listdisabled guild + +**Description** + +List disabled commands in this server. + +.. _core-command-command-listdisabledcogs: + +"""""""""""""""""""""""" +command listdisabledcogs +"""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]command listdisabledcogs + +**Description** + +List the cogs which are disabled in this guild. + +.. _core-command-contact: + +^^^^^^^ +contact +^^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]contact + +**Description** + +Sends a message to the owner. + +.. _core-command-dm: + +^^ +dm +^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]dm + +**Description** + +Sends a DM to a user. + +This command needs a user ID to work. +To get a user ID, go to Discord's settings and open the +'Appearance' tab. Enable 'Developer Mode', then right click +a user and click on 'Copy ID'. + +.. _core-command-embedset: + +^^^^^^^^ +embedset +^^^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]embedset + +**Description** + +Commands for toggling embeds on or off. + +This setting determines whether or not to +use embeds as a response to a command (for +commands that support it). The default is to +use embeds. + +.. _core-command-embedset-channel: + +"""""""""""""""" +embedset channel +"""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]embedset channel [enabled] + +**Description** + +Toggle the channel's embed setting. + +If enabled is None, the setting will be unset and +the guild default will be used instead. + +If set, this is used instead of the guild default +to determine whether or not to use embeds. This is +used for all commands done in a channel except +for help commands. + +.. _core-command-embedset-global: + +""""""""""""""" +embedset global +""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]embedset global + +**Description** + +Toggle the global embed setting. + +This is used as a fallback if the user +or guild hasn't set a preference. The +default is to use embeds. + +.. _core-command-embedset-server: + +""""""""""""""" +embedset server +""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]embedset server [enabled] + +.. tip:: Alias: ``embedset guild`` + +**Description** + +Toggle the guild's embed setting. + +If enabled is None, the setting will be unset and +the global default will be used instead. + +If set, this is used instead of the global default +to determine whether or not to use embeds. This is +used for all commands done in a guild channel except +for help commands. + +.. _core-command-embedset-showsettings: + +""""""""""""""""""""" +embedset showsettings +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]embedset showsettings + +**Description** + +Show the current embed settings. + +.. _core-command-embedset-user: + +""""""""""""" +embedset user +""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]embedset user [enabled] + +**Description** + +Toggle the user's embed setting for DMs. + +If enabled is None, the setting will be unset and +the global default will be used instead. + +If set, this is used instead of the global default +to determine whether or not to use embeds. This is +used for all commands executed in a DM with the bot. + +.. _core-command-helpset: + +^^^^^^^ +helpset +^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]helpset + +**Description** + +Manage settings for the help command. + +.. _core-command-helpset-deletedelay: + +""""""""""""""""""" +helpset deletedelay +""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset deletedelay + +**Description** + +Set the delay after which help pages will be deleted. + +The setting is disabled by default, and only applies to non-menu help, +sent in server text channels. +Setting the delay to 0 disables this feature. + +The bot has to have MANAGE_MESSAGES permission for this to work. + +.. _core-command-helpset-maxpages: + +"""""""""""""""" +helpset maxpages +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset maxpages + +**Description** + +Set the maximum number of help pages sent in a server channel. + +This setting does not apply to menu help. + +If a help message contains more pages than this value, the help message will +be sent to the command author via DM. This is to help reduce spam in server +text channels. + +The default value is 2 pages. + +.. _core-command-helpset-pagecharlimit: + +""""""""""""""""""""" +helpset pagecharlimit +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset pagecharlimit + +**Description** + +Set the character limit for each page in the help message. + +This setting only applies to embedded help. + +The default value is 1000 characters. The minimum value is 500. +The maximum is based on the lower of what you provide and what discord allows. + +Please note that setting a relatively small character limit may +mean some pages will exceed this limit. + +.. _core-command-helpset-resetformatter: + +"""""""""""""""""""""" +helpset resetformatter +"""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset resetformatter + +**Description** + +This resets Red's help formatter to the default formatter. + +.. _core-command-helpset-resetsettings: + +""""""""""""""""""""" +helpset resetsettings +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset resetsettings + +**Description** + +This resets Red's help settings to their defaults. + +This may not have an impact when using custom formatters from 3rd party cogs + +.. _core-command-helpset-showhidden: + +"""""""""""""""""" +helpset showhidden +"""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset showhidden [show_hidden] + +**Description** + +This allows the help command to show hidden commands. + +This defaults to False. +Using this without a setting will toggle. + +.. _core-command-helpset-showsettings: + +"""""""""""""""""""" +helpset showsettings +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset showsettings + +**Description** + +Show the current help settings. + +.. _core-command-helpset-tagline: + +""""""""""""""" +helpset tagline +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset tagline [tagline] + +**Description** + +Set the tagline to be used. + +This setting only applies to embedded help. If no tagline is +specified, the default will be used instead. + +.. _core-command-helpset-usemenus: + +"""""""""""""""" +helpset usemenus +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset usemenus [use_menus] + +**Description** + +Allows the help command to be sent as a paginated menu instead of separate +messages. + +This defaults to False. +Using this without a setting will toggle. + +.. _core-command-helpset-usetick: + +""""""""""""""" +helpset usetick +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset usetick [use_tick] + +**Description** + +This allows the help command message to be ticked if help is sent in a DM. + +Defaults to False. +Using this without a setting will toggle. + +.. _core-command-helpset-verifychecks: + +"""""""""""""""""""" +helpset verifychecks +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset verifychecks [verify] + +**Description** + +Sets if commands which can't be run in the current context should be +filtered from help. + +Defaults to True. +Using this without a setting will toggle. + +.. _core-command-helpset-verifyexists: + +"""""""""""""""""""" +helpset verifyexists +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]helpset verifyexists [verify] + +**Description** + +This allows the bot to respond indicating the existence of a specific +help topic even if the user can't use it. + +Note: This setting on it's own does not fully prevent command enumeration. + +Defaults to False. +Using this without a setting will toggle. + +.. _core-command-ignore: + +^^^^^^ +ignore +^^^^^^ + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]ignore + +**Description** + +Add servers or channels to the ignore list. + +.. _core-command-ignore-channel: + +"""""""""""""" +ignore channel +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]ignore channel [channel] + +**Description** + +Ignore commands in the channel or category. + +Defaults to the current channel. + +.. _core-command-ignore-list: + +""""""""""" +ignore list +""""""""""" + +**Syntax** + +.. code-block:: none + + [p]ignore list + +**Description** + +List the currently ignored servers and channels. + +.. _core-command-ignore-server: + +""""""""""""" +ignore server +""""""""""""" + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]ignore server + +.. tip:: Alias: ``ignore guild`` + +**Description** + +Ignore commands in this server. + +.. _core-command-info: + +^^^^ +info +^^^^ + +**Syntax** + +.. code-block:: none + + [p]info + +**Description** + +Shows info about Red. + +.. _core-command-invite: + +^^^^^^ +invite +^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]invite + +**Description** + +Shows Red's invite url. + +.. _core-command-inviteset: + +^^^^^^^^^ +inviteset +^^^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]inviteset + +**Description** + +Setup the bot's invite. + +.. _core-command-inviteset-perms: + +""""""""""""""" +inviteset perms +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]inviteset perms + +**Description** + +Make the bot create its own role with permissions on join. + +The bot will create its own role with the desired permissions when it joins a new server. This is a special role that can't be deleted or removed from the bot. + +For that, you need to provide a valid permissions level. +You can generate one here: https://discordapi.com/permissions.html + +Please note that you might need two factor authentication for some permissions. + +.. _core-command-inviteset-public: + +"""""""""""""""" +inviteset public +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]inviteset public [confirm=False] + +**Description** + +Define if the command should be accessible for the average user. + +.. _core-command-leave: + +^^^^^ +leave +^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]leave + +**Description** + +Leaves the current server. + +.. _core-command-licenseinfo: + +^^^^^^^^^^^ +licenseinfo +^^^^^^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]licenseinfo + +.. tip:: Alias: ``licenceinfo`` + +**Description** + +Get info about Red's licenses. + +.. _core-command-load: + +^^^^ +load +^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]load [cogs...] + +**Description** + +Loads packages. + +.. _core-command-localallowlist: + +^^^^^^^^^^^^^^ +localallowlist +^^^^^^^^^^^^^^ + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]localallowlist + +.. tip:: Alias: ``localwhitelist`` + +**Description** + +Server specific allowlist management commands. + +.. _core-command-localallowlist-add: + +"""""""""""""""""" +localallowlist add +"""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localallowlist add ... + +**Description** + +Adds a user or role to the server allowlist. + +.. _core-command-localallowlist-clear: + +"""""""""""""""""""" +localallowlist clear +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localallowlist clear + +**Description** + +Clears the allowlist. + +.. _core-command-localallowlist-list: + +""""""""""""""""""" +localallowlist list +""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localallowlist list + +**Description** + +Lists users and roles on the server allowlist. + +.. _core-command-localallowlist-remove: + +""""""""""""""""""""" +localallowlist remove +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localallowlist remove ... + +**Description** + +Removes user or role from the allowlist. + +.. _core-command-localblocklist: + +^^^^^^^^^^^^^^ +localblocklist +^^^^^^^^^^^^^^ + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]localblocklist + +.. tip:: Alias: ``localblacklist`` + +**Description** + +Server specific blocklist management commands. + +.. _core-command-localblocklist-add: + +"""""""""""""""""" +localblocklist add +"""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localblocklist add ... + +**Description** + +Adds a user or role to the blocklist. + +.. _core-command-localblocklist-clear: + +"""""""""""""""""""" +localblocklist clear +"""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localblocklist clear + +**Description** + +Clears the server blocklist. + +.. _core-command-localblocklist-list: + +""""""""""""""""""" +localblocklist list +""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localblocklist list + +**Description** + +Lists users and roles on the blocklist. + +.. _core-command-localblocklist-remove: + +""""""""""""""""""""" +localblocklist remove +""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]localblocklist remove ... + +**Description** + +Removes user or role from blocklist. + +.. _core-command-mydata: + +^^^^^^ +mydata +^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]mydata + +**Description** + +Commands which interact with the data Red has about you. + +.. _core-command-mydata-3rdparty: + +""""""""""""""" +mydata 3rdparty +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata 3rdparty + +**Description** + +View the End User Data statements of each 3rd-party module. + +.. _core-command-mydata-forgetme: + +""""""""""""""" +mydata forgetme +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata forgetme + +**Description** + +Have Red forget what it knows about you. + +This may not remove all data about you, data needed for operation, +such as command cooldowns will be kept until no longer necessary. + +Further interactions with Red may cause it to learn about you again. + +.. _core-command-mydata-getmydata: + +"""""""""""""""" +mydata getmydata +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata getmydata + +**Description** + +[Coming Soon] Get what data Red has about you. + +.. _core-command-mydata-ownermanagement: + +"""""""""""""""""""""" +mydata ownermanagement +"""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement + +**Description** + +Commands for more complete data handling. + +.. _core-command-mydata-ownermanagement-allowuserdeletions: + +""""""""""""""""""""""""""""""""""""""""" +mydata ownermanagement allowuserdeletions +""""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement allowuserdeletions + +**Description** + +Set the bot to allow users to request a data deletion. + +This is on by default. + +.. _core-command-mydata-ownermanagement-deleteforuser: + +"""""""""""""""""""""""""""""""""""" +mydata ownermanagement deleteforuser +"""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement deleteforuser + +**Description** + +Delete data Red has about a user for a user. + +.. _core-command-mydata-ownermanagement-deleteuserasowner: + +"""""""""""""""""""""""""""""""""""""""" +mydata ownermanagement deleteuserasowner +"""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement deleteuserasowner + +**Description** + +Delete data Red has about a user. + +.. _core-command-mydata-ownermanagement-disallowuserdeletions: + +"""""""""""""""""""""""""""""""""""""""""""" +mydata ownermanagement disallowuserdeletions +"""""""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement disallowuserdeletions + +**Description** + +Set the bot to not allow users to request a data deletion. + +.. _core-command-mydata-ownermanagement-processdiscordrequest: + +"""""""""""""""""""""""""""""""""""""""""""" +mydata ownermanagement processdiscordrequest +"""""""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement processdiscordrequest + +**Description** + +Handle a deletion request from Discord. + +.. _core-command-mydata-ownermanagement-setuserdeletionlevel: + +""""""""""""""""""""""""""""""""""""""""""" +mydata ownermanagement setuserdeletionlevel +""""""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata ownermanagement setuserdeletionlevel + +**Description** + +Sets how user deletions are treated. + +Level: + 0: What users can delete is left entirely up to each cog. + 1: Cogs should delete anything the cog doesn't need about the user. + +.. _core-command-mydata-whatdata: + +""""""""""""""" +mydata whatdata +""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]mydata whatdata + +**Description** + +Find out what type of data Red stores and why. + +.. _core-command-reload: + +^^^^^^ +reload +^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]reload [cogs...] + +**Description** + +Reloads packages. + +.. _core-command-restart: + +^^^^^^^ +restart +^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]restart [silently=False] + +**Description** + +Attempts to restart Red. + +Makes Red quit with exit code 26. +The restart is not guaranteed: it must be dealt +with by the process manager in use. + +.. _core-command-servers: + +^^^^^^^ +servers +^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]servers + +**Description** + +Lists and allows Red to leave servers. + +.. _core-command-set: + +^^^ +set +^^^ + +**Syntax** + +.. code-block:: none + + [p]set + +**Description** + +Changes Red's settings. + +.. _core-command-set-addadminrole: + +"""""""""""""""" +set addadminrole +"""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set addadminrole + +**Description** + +Adds an admin role for this guild. + +.. _core-command-set-addmodrole: + +"""""""""""""" +set addmodrole +"""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set addmodrole + +**Description** + +Adds a mod role for this guild. + +.. _core-command-set-api: + +""""""" +set api +""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set api + +**Description** + +Set, list or remove 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 +list of key,values as described by the cog requesting this command. + +Note: API tokens are sensitive and should only be used in a private channel +or in DM with the bot. + +.. _core-command-set-api-list: + +"""""""""""" +set api list +"""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set api list + +**Description** + +Show all external API services along with their keys that have been set. + +Secrets are not shown. + +.. _core-command-set-api-remove: + +"""""""""""""" +set api remove +"""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set api remove [services...] + +**Description** + +Remove the given services with all their keys and tokens. + +.. _core-command-set-avatar: + +"""""""""" +set avatar +"""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set avatar [url] + +**Description** + +Sets Red's avatar + +Supports either an attachment or an image URL. + +.. _core-command-set-avatar-remove: + +""""""""""""""""" +set avatar remove +""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set avatar remove + +.. tip:: Alias: ``set avatar clear`` + +**Description** + +Removes Red's avatar. + +.. _core-command-set-colour: + +"""""""""" +set colour +"""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set colour [colour] + +.. tip:: Alias: ``set color`` + +**Description** + +Sets a default colour to be used for the bot's embeds. + +Acceptable values for the colour parameter can be found at: + +https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.ColourConverter + +.. _core-command-set-custominfo: + +"""""""""""""" +set custominfo +"""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set custominfo [text] + +**Description** + +Customizes a section of ``[p]info``. + +The maximum amount of allowed characters is 1024. +Supports markdown, links and "mentions". +Link example: +```My link `_`` + +.. _core-command-set-deletedelay: + +""""""""""""""" +set deletedelay +""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set deletedelay [time] + +**Description** + +Set the delay until the bot removes the command message. + +Must be between -1 and 60. + +Set to -1 to disable this feature. + +.. _core-command-set-description: + +""""""""""""""" +set description +""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set description [description] + +**Description** + +Sets the bot's description. +Use without a description to reset. +This is shown in a few locations, including the help menu. + +The default is "Red V3". + +.. _core-command-set-fuzzy: + +""""""""" +set fuzzy +""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set fuzzy + +**Description** + +Toggle whether to enable fuzzy command search in DMs. + +Default is for fuzzy command search to be disabled. + +.. _core-command-set-globallocale: + +"""""""""""""""" +set globallocale +"""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set globallocale + +**Description** + +Changes the bot's default locale. +This will be used when a server has not set a locale, or in DMs. + +```` can be any language code with country code included, +e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. + +Go to Red's Crowdin page to see locales that are available with translations: +https://translate.discord.red + +To reset to English, use "en-US". + +.. _core-command-set-globalregionalformat: + +"""""""""""""""""""""""" +set globalregionalformat +"""""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set globalregionalformat [language_code] + +.. tip:: Alias: ``set globalregion`` + +**Description** + +Changes bot's regional format. This is used for formatting date, time and numbers. + +```` can be any language code with country code included, +e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. + +Leave ```` empty to base regional formatting on bot's locale. + +.. _core-command-set-listening: + +""""""""""""" +set listening +""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set listening [listening] + +**Description** + +Sets Red's listening status. + +.. _core-command-set-locale: + +"""""""""" +set locale +"""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set locale + +**Description** + +Changes the bot's locale in this server. + +```` can be any language code with country code included, +e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. + +Go to Red's Crowdin page to see locales that are available with translations: +https://translate.discord.red + +Use "default" to return to the bot's default set language. +To reset to English, use "en-US". + +.. _core-command-set-nickname: + +"""""""""""" +set nickname +"""""""""""" + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]set nickname [nickname] + +**Description** + +Sets Red's nickname. + +.. _core-command-set-ownernotifications: + +"""""""""""""""""""""" +set ownernotifications +"""""""""""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications + +**Description** + +Commands for configuring owner notifications. + +.. _core-command-set-ownernotifications-adddestination: + +""""""""""""""""""""""""""""""""""""" +set ownernotifications adddestination +""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications adddestination + +**Description** + +Adds a destination text channel to receive owner notifications. + +.. _core-command-set-ownernotifications-listdestinations: + +""""""""""""""""""""""""""""""""""""""" +set ownernotifications listdestinations +""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications listdestinations + +**Description** + +Lists the configured extra destinations for owner notifications. + +.. _core-command-set-ownernotifications-optin: + +"""""""""""""""""""""""""""" +set ownernotifications optin +"""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications optin + +**Description** + +Opt-in on receiving owner notifications. + +This is the default state. + +.. _core-command-set-ownernotifications-optout: + +""""""""""""""""""""""""""""" +set ownernotifications optout +""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications optout + +**Description** + +Opt-out of receiving owner notifications. + +.. _core-command-set-ownernotifications-removedestination: + +"""""""""""""""""""""""""""""""""""""""" +set ownernotifications removedestination +"""""""""""""""""""""""""""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set ownernotifications removedestination + +.. tip:: Aliases: ``set ownernotifications remdestination``, ``set ownernotifications deletedestination``, ``set ownernotifications deldestination`` + +**Description** + +Removes a destination text channel from receiving owner notifications. + +.. _core-command-set-playing: + +""""""""""" +set playing +""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set playing [game] + +.. tip:: Alias: ``set game`` + +**Description** + +Sets Red's playing status. + +.. _core-command-set-prefix: + +"""""""""" +set prefix +"""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set prefix [prefixes...] + +.. tip:: Alias: ``set prefixes`` + +**Description** + +Sets Red's global prefix(es). + +.. _core-command-set-regionalformat: + +"""""""""""""""""" +set regionalformat +"""""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set regionalformat [language_code] + +.. tip:: Alias: ``set region`` + +**Description** + +Changes bot's regional format in this server. This is used for formatting date, time and numbers. + +```` can be any language code with country code included, +e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. + +Leave ```` empty to base regional formatting on bot's locale in this server. + +.. _core-command-set-removeadminrole: + +""""""""""""""""""" +set removeadminrole +""""""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set removeadminrole + +.. tip:: Aliases: ``set remadmindrole``, ``set deladminrole``, ``set deleteadminrole`` + +**Description** + +Removes an admin role for this guild. + +.. _core-command-set-removemodrole: + +""""""""""""""""" +set removemodrole +""""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set removemodrole + +.. tip:: Aliases: ``set remmodrole``, ``set delmodrole``, ``set deletemodrole`` + +**Description** + +Removes a mod role for this guild. + +.. _core-command-set-serverfuzzy: + +""""""""""""""" +set serverfuzzy +""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set serverfuzzy + +**Description** + +Toggle whether to enable fuzzy command search for the server. + +Default is for fuzzy command search to be disabled. + +.. _core-command-set-serverprefix: + +"""""""""""""""" +set serverprefix +"""""""""""""""" + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]set serverprefix [prefixes...] + +.. tip:: Alias: ``set serverprefixes`` + +**Description** + +Sets Red's server prefix(es). + +.. _core-command-set-showsettings: + +"""""""""""""""" +set showsettings +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]set showsettings + +**Description** + +Show the current settings for Red. + +.. _core-command-set-status: + +"""""""""" +set status +"""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set status + +**Description** + +Sets Red's status. + +Available statuses: + online + idle + dnd + invisible + +.. _core-command-set-streaming: + +""""""""""""" +set streaming +""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set streaming [streamer] [stream_title] + +.. tip:: Alias: ``set stream`` + +**Description** + +Sets Red's streaming status. + +Leaving both streamer and stream_title empty will clear it. + +.. _core-command-set-usebotcolour: + +"""""""""""""""" +set usebotcolour +"""""""""""""""" + +.. note:: |guildowner-lock| + +**Syntax** + +.. code-block:: none + + [p]set usebotcolour + +.. tip:: Alias: ``set usebotcolor`` + +**Description** + +Toggle whether to use the bot owner-configured colour for embeds. + +Default is to use the bot's configured colour. +Otherwise, the colour used will be the colour of the bot's top role. + +.. _core-command-set-username: + +"""""""""""" +set username +"""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set username + +.. tip:: Alias: ``set name`` + +**Description** + +Sets Red's username. + +.. _core-command-set-watching: + +"""""""""""" +set watching +"""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set watching [watching] + +**Description** + +Sets Red's watching status. + +.. _core-command-shutdown: + +^^^^^^^^ +shutdown +^^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]shutdown [silently=False] + +**Description** + +Shuts down the bot. + +.. _core-command-traceback: + +^^^^^^^^^ +traceback +^^^^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]traceback [public=False] + +**Description** + +Sends to the owner the last command exception that has occurred. + +If public (yes is specified), it will be sent to the chat instead. + +.. _core-command-unignore: + +^^^^^^^^ +unignore +^^^^^^^^ + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]unignore + +**Description** + +Remove servers or channels from the ignore list. + +.. _core-command-unignore-channel: + +"""""""""""""""" +unignore channel +"""""""""""""""" + +**Syntax** + +.. code-block:: none + + [p]unignore channel [channel] + +**Description** + +Remove a channel or category from the ignore list. + +Defaults to the current channel. + +.. _core-command-unignore-server: + +""""""""""""""" +unignore server +""""""""""""""" + +.. note:: |admin-lock| + +**Syntax** + +.. code-block:: none + + [p]unignore server + +.. tip:: Alias: ``unignore guild`` + +**Description** + +Remove this server from the ignore list. + +.. _core-command-unload: + +^^^^^^ +unload +^^^^^^ + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]unload [cogs...] + +**Description** + +Unloads packages. + +.. _core-command-uptime: + +^^^^^^ +uptime +^^^^^^ + +**Syntax** + +.. code-block:: none + + [p]uptime + +**Description** + +Shows Red's uptime. diff --git a/docs/index.rst b/docs/index.rst index 9b9683fd8..3c9f0e23d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,6 +37,7 @@ Welcome to Red - Discord Bot's documentation! cog_guides/bank cog_guides/cleanup cog_guides/cog_manager_ui + cog_guides/core cog_guides/customcommands red_core_data_statement From 9378f2d9210ad0773733361bd727247b39966341 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 17 Nov 2020 19:15:36 -0500 Subject: [PATCH 02/22] Mydata docstrings --- redbot/core/core_commands.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index dca184555..3775a1945 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -385,7 +385,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() async def info(self, ctx: commands.Context): - """Shows info about [botname].""" + """Shows info about [botname]. + + See `[p]custominfo` to customize. + """ embed_links = await ctx.embed_requested() author_repo = "https://github.com/Twentysix26" org_repo = "https://github.com/Cog-Creators" @@ -520,14 +523,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.group(cls=commands.commands._AlwaysAvailableGroup) async def mydata(self, ctx: commands.Context): - """ Commands which interact with the data [botname] has about you. """ + """Commands which interact with the data [botname] has about you. + + More information can be found in the (End User Data Documentation)[https://docs.discord.red/en/stable/red_core_data_statement.html] + """ # 1/10 minutes. It's a static response, but the inability to lock # will annoy people if it's spammable @commands.cooldown(1, 600, commands.BucketType.user) @mydata.command(cls=commands.commands._AlwaysAvailableCommand, name="whatdata") async def mydata_whatdata(self, ctx: commands.Context): - """ Find out what type of data [botname] stores and why. """ + """Find out what type of data [botname] stores and why.""" ver = "latest" if red_version_info.dev_release else "stable" link = f"https://docs.discord.red/en/{ver}/red_core_data_statement.html" From d1d81f4d125495b3d1154691d55e3853d2394204 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 27 Nov 2020 16:00:41 -0500 Subject: [PATCH 03/22] Regenerated docs --- docs/cog_guides/core.rst | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 76666056d..66b6ff86d 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -1084,6 +1084,8 @@ info Shows info about Red. +See ``[p]custominfo`` to customize. + .. _core-command-invite: ^^^^^^ @@ -1393,7 +1395,9 @@ mydata **Description** -Commands which interact with the data Red has about you. +Commands which interact with the data Red has about you. + +More information can be found in the :ref:`End User Data Documentation ` .. _core-command-mydata-3rdparty: @@ -1409,7 +1413,9 @@ mydata 3rdparty **Description** -View the End User Data statements of each 3rd-party module. +View the End User Data statements of each 3rd-party module. + +This will send an attachment with the End User Data statements of all loaded 3rd party cog. .. _core-command-mydata-forgetme: @@ -1446,7 +1452,7 @@ mydata getmydata **Description** -[Coming Soon] Get what data Red has about you. +[Coming Soon] Get what data Red has about you. .. _core-command-mydata-ownermanagement: @@ -1483,6 +1489,7 @@ mydata ownermanagement allowuserdeletions Set the bot to allow users to request a data deletion. This is on by default. +Opposite of ``[p]mydata ownermanagement disallowuserdeletions`` .. _core-command-mydata-ownermanagement-deleteforuser: @@ -1532,6 +1539,8 @@ mydata ownermanagement disallowuserdeletions Set the bot to not allow users to request a data deletion. +Opposite of ``[p]mydata ownermanagement allowuserdeletions`` + .. _core-command-mydata-ownermanagement-processdiscordrequest: """""""""""""""""""""""""""""""""""""""""""" @@ -1565,8 +1574,8 @@ mydata ownermanagement setuserdeletionlevel Sets how user deletions are treated. Level: - 0: What users can delete is left entirely up to each cog. - 1: Cogs should delete anything the cog doesn't need about the user. + - ``0``: What users can delete is left entirely up to each cog. + - ``1``: Cogs should delete anything the cog doesn't need about the user. .. _core-command-mydata-whatdata: @@ -1582,7 +1591,7 @@ mydata whatdata **Description** -Find out what type of data Red stores and why. +Find out what type of data Red stores and why. .. _core-command-reload: @@ -1818,6 +1827,24 @@ Acceptable values for the colour parameter can be found at: https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.ColourConverter +.. _core-command-set-competing: + +""""""""""""" +set competing +""""""""""""" + +.. note:: |owner-lock| + +**Syntax** + +.. code-block:: none + + [p]set competing [competing] + +**Description** + +Sets Red's competing status. + .. _core-command-set-custominfo: """""""""""""" From 5c93ea86449a07b9ae5b20aacfb4dc5e7ef26d82 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 27 Nov 2020 16:00:51 -0500 Subject: [PATCH 04/22] Lots more docstrings --- redbot/core/core_commands.py | 124 +++++++++++++++++++++++++++++------ 1 file changed, 105 insertions(+), 19 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 1b1491742..4fa3cf1a6 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -525,7 +525,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata(self, ctx: commands.Context): """Commands which interact with the data [botname] has about you. - More information can be found in the (End User Data Documentation)[https://docs.discord.red/en/stable/red_core_data_statement.html] + More information can be found in the [End User Data Documentation.](https://docs.discord.red/en/stable/red_core_data_statement.html) """ # 1/10 minutes. It's a static response, but the inability to lock @@ -557,7 +557,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.cooldown(1, 1800, commands.BucketType.user) @mydata.command(cls=commands.commands._AlwaysAvailableCommand, name="3rdparty") async def mydata_3rd_party(self, ctx: commands.Context): - """ View the End User Data statements of each 3rd-party module. """ + """View the End User Data statements of each 3rd-party module. + + This will send an attachment with the End User Data statements of all loaded 3rd party cog. + """ # Can't check this as a command check, and want to prompt DMs as an option. if not ctx.channel.permissions_for(ctx.me).attach_files: @@ -737,7 +740,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.cooldown(1, 7200, commands.BucketType.user) @mydata.command(cls=commands.commands._AlwaysAvailableCommand, name="getmydata") async def mydata_getdata(self, ctx: commands.Context): - """ [Coming Soon] Get what data [botname] has about you. """ + """[Coming Soon] Get what data [botname] has about you.""" await ctx.send( _( "This command doesn't do anything yet, " @@ -758,6 +761,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Set the bot to allow users to request a data deletion. This is on by default. + Opposite of `[p]mydata ownermanagement disallowuserdeletions` """ await ctx.bot._config.datarequests.allow_user_requests.set(True) await ctx.send( @@ -771,6 +775,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata_owner_disallow_user_deletions(self, ctx): """ Set the bot to not allow users to request a data deletion. + + Opposite of `[p]mydata ownermanagement allowuserdeletions` """ await ctx.bot._config.datarequests.allow_user_requests.set(False) await ctx.send(_("User can not delete their own data.")) @@ -780,9 +786,16 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Sets how user deletions are treated. + Example: + - `[p]mydata ownermanagement setuserdeletionlevel 1` + + **Arguments:** + + - `` The strictness level for user deletion. See Level guide below. + Level: - 0: What users can delete is left entirely up to each cog. - 1: Cogs should delete anything the cog doesn't need about the user. + - `0`: What users can delete is left entirely up to each cog. + - `1`: Cogs should delete anything the cog doesn't need about the user. """ if level == 1: @@ -809,6 +822,15 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata_discord_deletion_request(self, ctx, user_id: int): """ Handle a deletion request from Discord. + + This will cause the bot to get rid of or disassociate all data from the specified user ID. + You should not use this unless Discord has specifically requested this with regard to a deleted user. + This will remove the user from various anti-abuse measures. + If you are processing a manual request from a user, you may want `[p]mydata ownermanagement deleteforuser` instead. + + **Arguments:** + + - `` The id of the user whose data would be deleted. """ if not await self.get_serious_confirmation( @@ -819,7 +841,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): "Discord has specifically requested this with regard to a deleted user. " "This will remove the user from various anti-abuse measures. " "If you are processing a manual request from a user, you may want " - "`{prefix}{command_name}` instead" + "`{prefix}{command_name}` instead." "\n\nIf you are sure this is what you intend to do " "please respond with the following:" ).format(prefix=ctx.clean_prefix, command_name="mydata ownermanagement deleteforuser"), @@ -878,7 +900,16 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @mydata_owner_management.command(name="deleteforuser") async def mydata_user_deletion_request_by_owner(self, ctx, user_id: int): - """ Delete data [botname] has about a user for a user. """ + """Delete data [botname] has about a user for a user. + + This will cause the bot to get rid of or disassociate a lot of non-operational data from the specified user. + Users have access to different command for this unless they can't interact with the bot at all. + This is a mostly safe operation, but you should not use it unless processing a request from this user as it may impact their usage of the bot. + + **Arguments:** + + - `` The id of the user whose data would be deleted. + """ if not await self.get_serious_confirmation( ctx, _( @@ -956,7 +987,15 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @mydata_owner_management.command(name="deleteuserasowner") async def mydata_user_deletion_by_owner(self, ctx, user_id: int): - """ Delete data [botname] has about a user. """ + """Delete data [botname] has about a user. + + This will cause the bot to get rid of or disassociate a lot of data about the specified user. + This may include more than just end user data, including anti abuse records. + + **Arguments:** + + - `` The id of the user whose data would be deleted. + """ if not await self.get_serious_confirmation( ctx, _( @@ -1023,10 +1062,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Commands for toggling embeds on or off. - This setting determines whether or not to - use embeds as a response to a command (for - commands that support it). The default is to - use embeds. + This setting determines whether or not to use embeds as a response to a command (for commands that support it). + The default is to use embeds. """ @embedset.command(name="showsettings") @@ -1051,9 +1088,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Toggle the global embed setting. - This is used as a fallback if the user - or guild hasn't set a preference. The - default is to use embeds. + This is used as a fallback if the user or guild hasn't set a preference. + The default is to use embeds. """ current = await self.bot._config.embeds() await self.bot._config.embeds.set(not current) @@ -1075,6 +1111,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): to determine whether or not to use embeds. This is used for all commands done in a guild channel except for help commands. + + Examples: + - `[p]embedset server False` - Disables embeds on this server. + - `[p]embedset server` - Resets value to use global default. + + **Arguments:** + + - `` Whether to use embeds on this server. Leave blank to reset to default. """ await self.bot._config.guild(ctx.guild).embeds.set(enabled) if enabled is None: @@ -1100,6 +1144,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): to determine whether or not to use embeds. This is used for all commands done in a channel except for help commands. + + Examples: + - `[p]embedset channel False` - Disables embeds in this channel. + - `[p]embedset channel` - Resets value to use guild default. + + **Arguments:** + + - `` Whether to use embeds in this channel. Leave blank to reset to default. """ await self.bot._config.channel(ctx.channel).embeds.set(enabled) if enabled is None: @@ -1122,6 +1174,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): If set, this is used instead of the global default to determine whether or not to use embeds. This is used for all commands executed in a DM with the bot. + + Examples: + - `[p]embedset user False` - Disables embeds in your DMs. + - `[p]embedset user` - Resets value to use global default. + + **Arguments:** + + - `` Whether to use embeds in your DMs. Leave blank to reset to default. """ await self.bot._config.user(ctx.author).embeds.set(enabled) if enabled is None: @@ -1138,7 +1198,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def traceback(self, ctx: commands.Context, public: bool = False): """Sends to the owner the last command exception that has occurred. - If public (yes is specified), it will be sent to the chat instead.""" + If public (yes is specified), it will be sent to the chat instead. + + Warning: Sending the traceback publicly can accidentally reveal + sensitive information about your computer or configuration. + + Examples: + - `[p]traceback` - Sends the traceback to your DMs. + - `[p]traceback True` - Sends the last traceback in the current context. + + **Arguments:** + + - `` Whether to send traceback to the current context. Leave blank to send to DMs. + """ if not public: destination = ctx.author else: @@ -1160,7 +1232,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @commands.check(CoreLogic._can_get_invite_url) async def invite(self, ctx): - """Shows [botname]'s invite url.""" + """Shows [botname]'s invite url. + + This will always send the invite to DMs to keep it private. + """ try: await ctx.author.send(await self._invite_url()) except discord.errors.Forbidden: @@ -1172,13 +1247,22 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.group() @checks.is_owner() async def inviteset(self, ctx): - """Setup the bot's invite.""" + """Commands to setup [botname]'s invite settings.""" pass @inviteset.command() async def public(self, ctx, confirm: bool = False): """ - Define if the command should be accessible for the average user. + Toggles if `[p]invite` should be accessible for the average user. + + Bot must me made into a `Public bot` in the developer dashboard for public invites to work. + + Example: + - `[p]inviteset public yes` - Toggles the public invite setting. + + **Arguments:** + + - `` Required to set to public. Not required to toggle back to private. """ if await self.bot._config.invite_public(): await self.bot._config.invite_public.set(False) @@ -1629,6 +1713,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Must be between -1 and 60. Set to -1 to disable this feature. + + This is applied only the current server and not globally. """ guild = ctx.guild if time is not None: From 888af0db3b0a1f5778900252e8d7310de12e2d65 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 27 Nov 2020 16:00:58 -0500 Subject: [PATCH 05/22] Add document link --- docs/red_core_data_statement.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/red_core_data_statement.rst b/docs/red_core_data_statement.rst index ab7045d35..17fcba85b 100644 --- a/docs/red_core_data_statement.rst +++ b/docs/red_core_data_statement.rst @@ -1,4 +1,5 @@ .. Red Core Data Statement +.. _red_core_data_statement: ===================== Red and End User Data From c7d0e2513d526159f806a5237b071e2712c5cb89 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 27 Nov 2020 23:10:23 -0500 Subject: [PATCH 06/22] Up to load docstrings --- redbot/core/core_commands.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 4fa3cf1a6..dd5f879e5 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1118,7 +1118,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `` Whether to use embeds on this server. Leave blank to reset to default. + - `[enabled]` Whether to use embeds on this server. Leave blank to reset to default. """ await self.bot._config.guild(ctx.guild).embeds.set(enabled) if enabled is None: @@ -1151,7 +1151,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `` Whether to use embeds in this channel. Leave blank to reset to default. + - `[enabled]` Whether to use embeds in this channel. Leave blank to reset to default. """ await self.bot._config.channel(ctx.channel).embeds.set(enabled) if enabled is None: @@ -1181,7 +1181,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `` Whether to use embeds in your DMs. Leave blank to reset to default. + - `[enabled]` Whether to use embeds in your DMs. Leave blank to reset to default. """ await self.bot._config.user(ctx.author).embeds.set(enabled) if enabled is None: @@ -1209,7 +1209,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `` Whether to send traceback to the current context. Leave blank to send to DMs. + - `[public]` Whether to send traceback to the current context. Leave blank to send to DMs. """ if not public: destination = ctx.author @@ -1262,7 +1262,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `` Required to set to public. Not required to toggle back to private. + - `[confirm]` Required to set to public. Not required to toggle back to private. """ if await self.bot._config.invite_public(): await self.bot._config.invite_public.set(False) @@ -1330,7 +1330,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @checks.is_owner() async def servers(self, ctx: commands.Context): - """Lists and allows [botname] to leave servers.""" + """Lists and allows [botname] to leave servers. + + Note: This command is interactive. + """ guilds = sorted(list(self.bot.guilds), key=lambda s: s.name.lower()) msg = "" responses = [] @@ -1375,7 +1378,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @checks.is_owner() async def load(self, ctx: commands.Context, *cogs: str): - """Loads packages.""" + """Loads packages from the local paths and installed cogs. + + See available packages with `[p]cogs`. + + Examples: + - `[p]load general` - Loads the `general` cog. + - `[p]load admin mod mutes` - Loads multiple cogs. + + **Arguments:** + + - `[cogs...]` Required to set to public. Not required to toggle back to private. + """ if not cogs: return await ctx.send_help() cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) From 6452fc6b6a3f7b0a505049bcfe980b68763d3da7 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 27 Nov 2020 23:54:16 -0500 Subject: [PATCH 07/22] Black formatting --- redbot/core/core_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index dd5f879e5..5cb8d3727 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -525,8 +525,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata(self, ctx: commands.Context): """Commands which interact with the data [botname] has about you. - More information can be found in the [End User Data Documentation.](https://docs.discord.red/en/stable/red_core_data_statement.html) - """ + More information can be found in the [End User Data Documentation.](https://docs.discord.red/en/stable/red_core_data_statement.html) + """ # 1/10 minutes. It's a static response, but the inability to lock # will annoy people if it's spammable From 6dd9c055719d6f0b0eaf856e102510910586f00c Mon Sep 17 00:00:00 2001 From: bobloy Date: Mon, 30 Nov 2020 09:20:43 -0500 Subject: [PATCH 08/22] docstring semantics --- redbot/core/core_commands.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 5cb8d3727..29ddc0e8a 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1380,7 +1380,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def load(self, ctx: commands.Context, *cogs: str): """Loads packages from the local paths and installed cogs. - See available packages with `[p]cogs`. + See packages available to load with `[p]cogs`. Examples: - `[p]load general` - Loads the `general` cog. @@ -1500,7 +1500,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @checks.is_owner() async def unload(self, ctx: commands.Context, *cogs: str): - """Unloads packages.""" + """Unloads packages. + + See packages available to unload with `[p]cogs`. + + Examples: + - `[p]load general` - Loads the `general` cog. + - `[p]load admin mod mutes` - Loads multiple cogs. + + **Arguments:** + + - `[cogs...]` Required to set to public. Not required to toggle back to private.""" if not cogs: return await ctx.send_help() cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) From 0bd77f502196556474e70e6325b960948fd3940b Mon Sep 17 00:00:00 2001 From: bobloy Date: Mon, 30 Nov 2020 12:21:30 -0500 Subject: [PATCH 09/22] "cog packages" for loads --- redbot/core/core_commands.py | 38 +++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 29ddc0e8a..806866655 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -989,8 +989,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata_user_deletion_by_owner(self, ctx, user_id: int): """Delete data [botname] has about a user. - This will cause the bot to get rid of or disassociate a lot of data about the specified user. - This may include more than just end user data, including anti abuse records. + This will cause the bot to get rid of or disassociate a lot of data about the specified + user. This may include more than just end user data, including anti abuse records. **Arguments:** @@ -1062,8 +1062,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Commands for toggling embeds on or off. - This setting determines whether or not to use embeds as a response to a command (for commands that support it). - The default is to use embeds. + This setting determines whether or not to use embeds as a response to a command (for + commands that support it). The default is to use embeds. """ @embedset.command(name="showsettings") @@ -1378,17 +1378,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @checks.is_owner() async def load(self, ctx: commands.Context, *cogs: str): - """Loads packages from the local paths and installed cogs. + """Loads cog packages from the local paths and installed cogs. See packages available to load with `[p]cogs`. + Additional cogs can be added using Downloader, or from local paths using `[p]addpath`. + Examples: - `[p]load general` - Loads the `general` cog. - `[p]load admin mod mutes` - Loads multiple cogs. **Arguments:** - - `[cogs...]` Required to set to public. Not required to toggle back to private. + - `[cogs...]` The cog packages to load. """ if not cogs: return await ctx.send_help() @@ -1500,17 +1502,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command() @checks.is_owner() async def unload(self, ctx: commands.Context, *cogs: str): - """Unloads packages. + """Unloads previously loaded cog packages. See packages available to unload with `[p]cogs`. Examples: - - `[p]load general` - Loads the `general` cog. - - `[p]load admin mod mutes` - Loads multiple cogs. + - `[p]unload general` - Unloads the `general` cog. + - `[p]unload admin mod mutes` - Unloads multiple cogs. **Arguments:** - - `[cogs...]` Required to set to public. Not required to toggle back to private.""" + - `[cogs...]` The cog packages to unload. + """ if not cogs: return await ctx.send_help() cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) @@ -1548,7 +1551,20 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command(name="reload") @checks.is_owner() async def reload(self, ctx: commands.Context, *cogs: str): - """Reloads packages.""" + """Reloads cog packages. + + This will unload and then load the specified cogs. + + Cogs that were not loaded will be loaded. + + Examples: + - `[p]reload general` - Unloads then loads the `general` cog. + - `[p]reload admin mod mutes` - Unloads then loads multiple cogs. + + **Arguments:** + + - `[cogs...]` The cog packages to unload. + """ if not cogs: return await ctx.send_help() cogs = tuple(map(lambda cog: cog.rstrip(","), cogs)) From c991e8b62f5c849e005f8e027018b4a22bbce3b0 Mon Sep 17 00:00:00 2001 From: bobloy Date: Mon, 30 Nov 2020 13:10:26 -0500 Subject: [PATCH 10/22] Refix line lengths --- redbot/core/core_commands.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 806866655..e62f530f8 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -47,7 +47,6 @@ from .utils.chat_formatting import ( ) from .commands.requires import PrivilegeLevel - _entities = { "*": "*", "\\": "\", @@ -92,7 +91,6 @@ __all__ = ["Core"] log = logging.getLogger("red") - _ = i18n.Translator("Core", __file__) TokenConverter = commands.get_dict_converter(delims=[" ", ",", ";"]) @@ -989,8 +987,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def mydata_user_deletion_by_owner(self, ctx, user_id: int): """Delete data [botname] has about a user. - This will cause the bot to get rid of or disassociate a lot of data about the specified - user. This may include more than just end user data, including anti abuse records. + This will cause the bot to get rid of or disassociate a lot of data about the specified user. + This may include more than just end user data, including anti abuse records. **Arguments:** @@ -1062,8 +1060,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Commands for toggling embeds on or off. - This setting determines whether or not to use embeds as a response to a command (for - commands that support it). The default is to use embeds. + This setting determines whether or not to use embeds as a response to a command (for commands that support it). + The default is to use embeds. """ @embedset.command(name="showsettings") From e3e9a288dd6e57bdc046731130cef0c78c8621e7 Mon Sep 17 00:00:00 2001 From: bobloy Date: Mon, 30 Nov 2020 17:06:51 -0500 Subject: [PATCH 11/22] Regenerate docs --- docs/cog_guides/core.rst | 142 ++++++++++++++++++++++++++++++++++----- 1 file changed, 127 insertions(+), 15 deletions(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 66b6ff86d..6fb525488 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -619,10 +619,8 @@ embedset Commands for toggling embeds on or off. -This setting determines whether or not to -use embeds as a response to a command (for -commands that support it). The default is to -use embeds. +This setting determines whether or not to use embeds as a response to a command (for commands that support it). +The default is to use embeds. .. _core-command-embedset-channel: @@ -650,6 +648,14 @@ to determine whether or not to use embeds. This is used for all commands done in a channel except for help commands. +Examples: + - ``[p]embedset channel False`` - Disables embeds in this channel. + - ``[p]embedset channel`` - Resets value to use guild default. + +**Arguments:** + +- ``[enabled]`` Whether to use embeds in this channel. Leave blank to reset to default. + .. _core-command-embedset-global: """"""""""""""" @@ -668,9 +674,8 @@ embedset global Toggle the global embed setting. -This is used as a fallback if the user -or guild hasn't set a preference. The -default is to use embeds. +This is used as a fallback if the user or guild hasn't set a preference. +The default is to use embeds. .. _core-command-embedset-server: @@ -700,6 +705,14 @@ to determine whether or not to use embeds. This is used for all commands done in a guild channel except for help commands. +Examples: + - ``[p]embedset server False`` - Disables embeds on this server. + - ``[p]embedset server`` - Resets value to use global default. + +**Arguments:** + +- ``[enabled]`` Whether to use embeds on this server. Leave blank to reset to default. + .. _core-command-embedset-showsettings: """"""""""""""""""""" @@ -739,6 +752,14 @@ If set, this is used instead of the global default to determine whether or not to use embeds. This is used for all commands executed in a DM with the bot. +Examples: + - ``[p]embedset user False`` - Disables embeds in your DMs. + - ``[p]embedset user`` - Resets value to use global default. + +**Arguments:** + +- ``[enabled]`` Whether to use embeds in your DMs. Leave blank to reset to default. + .. _core-command-helpset: ^^^^^^^ @@ -1102,6 +1123,8 @@ invite Shows Red's invite url. +This will always send the invite to DMs to keep it private. + .. _core-command-inviteset: ^^^^^^^^^ @@ -1118,7 +1141,7 @@ inviteset **Description** -Setup the bot's invite. +Commands to setup Red's invite settings. .. _core-command-inviteset-perms: @@ -1157,7 +1180,16 @@ inviteset public **Description** -Define if the command should be accessible for the average user. +Toggles if ``[p]invite`` should be accessible for the average user. + +Bot must me made into a ``Public bot`` in the developer dashboard for public invites to work. + +Example: + - ``[p]inviteset public yes`` - Toggles the public invite setting. + +**Arguments:** + +- ``[confirm]`` Required to set to public. Not required to toggle back to private. .. _core-command-leave: @@ -1211,7 +1243,19 @@ load **Description** -Loads packages. +Loads cog packages from the local paths and installed cogs. + +See packages available to load with ``[p]cogs``. + +Additional cogs can be added using Downloader, or from local paths using ``[p]addpath``. + +Examples: + - ``[p]load general`` - Loads the ``general`` cog. + - ``[p]load admin mod mutes`` - Loads multiple cogs. + +**Arguments:** + +- ``[cogs...]`` The cog packages to load. .. _core-command-localallowlist: @@ -1397,7 +1441,7 @@ mydata Commands which interact with the data Red has about you. -More information can be found in the :ref:`End User Data Documentation ` +More information can be found in the :ref:`End User Data Documentation.` .. _core-command-mydata-3rdparty: @@ -1505,7 +1549,15 @@ mydata ownermanagement deleteforuser **Description** -Delete data Red has about a user for a user. +Delete data Red has about a user for a user. + +This will cause the bot to get rid of or disassociate a lot of non-operational data from the specified user. +Users have access to different command for this unless they can't interact with the bot at all. +This is a mostly safe operation, but you should not use it unless processing a request from this user as it may impact their usage of the bot. + +**Arguments:** + +- ```` The id of the user whose data would be deleted. .. _core-command-mydata-ownermanagement-deleteuserasowner: @@ -1521,7 +1573,14 @@ mydata ownermanagement deleteuserasowner **Description** -Delete data Red has about a user. +Delete data Red has about a user. + +This will cause the bot to get rid of or disassociate a lot of data about the specified user. +This may include more than just end user data, including anti abuse records. + +**Arguments:** + +- ```` The id of the user whose data would be deleted. .. _core-command-mydata-ownermanagement-disallowuserdeletions: @@ -1557,6 +1616,15 @@ mydata ownermanagement processdiscordrequest Handle a deletion request from Discord. +This will cause the bot to get rid of or disassociate all data from the specified user ID. +You should not use this unless Discord has specifically requested this with regard to a deleted user. +This will remove the user from various anti-abuse measures. +If you are processing a manual request from a user, you may want ``[p]mydata ownermanagement deleteforuser`` instead. + +**Arguments:** + +- ```` The id of the user whose data would be deleted. + .. _core-command-mydata-ownermanagement-setuserdeletionlevel: """"""""""""""""""""""""""""""""""""""""""" @@ -1573,6 +1641,13 @@ mydata ownermanagement setuserdeletionlevel Sets how user deletions are treated. +Example: + - ``[p]mydata ownermanagement setuserdeletionlevel 1`` + +**Arguments:** + +- ```` The strictness level for user deletion. See Level guide below. + Level: - ``0``: What users can delete is left entirely up to each cog. - ``1``: Cogs should delete anything the cog doesn't need about the user. @@ -1609,7 +1684,19 @@ reload **Description** -Reloads packages. +Reloads cog packages. + +This will unload and then load the specified cogs. + +Cogs that were not loaded will be loaded. + +Examples: + - ``[p]reload general`` - Unloads then loads the ``general`` cog. + - ``[p]reload admin mod mutes`` - Unloads then loads multiple cogs. + +**Arguments:** + +- ``[cogs...]`` The cog packages to unload. .. _core-command-restart: @@ -1651,6 +1738,8 @@ servers Lists and allows Red to leave servers. +Note: This command is interactive. + .. _core-command-set: ^^^ @@ -1890,6 +1979,8 @@ Must be between -1 and 60. Set to -1 to disable this feature. +This is applied only the current server and not globally. + .. _core-command-set-description: """"""""""""""" @@ -2455,6 +2546,17 @@ Sends to the owner the last command exception that has occurred. If public (yes is specified), it will be sent to the chat instead. +Warning: Sending the traceback publicly can accidentally reveal +sensitive information about your computer or configuration. + +Examples: + - ``[p]traceback`` - Sends the traceback to your DMs. + - ``[p]traceback True`` - Sends the last traceback in the current context. + +**Arguments:** + +- ``[public]`` Whether to send traceback to the current context. Leave blank to send to DMs. + .. _core-command-unignore: ^^^^^^^^ @@ -2527,7 +2629,17 @@ unload **Description** -Unloads packages. +Unloads previously loaded cog packages. + +See packages available to unload with ``[p]cogs``. + +Examples: + - ``[p]unload general`` - Unloads the ``general`` cog. + - ``[p]unload admin mod mutes`` - Unloads multiple cogs. + +**Arguments:** + +- ``[cogs...]`` The cog packages to unload. .. _core-command-uptime: From aa6927fa72f01b0c030f45937e645ef7c49f294d Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 2 Dec 2020 16:23:38 -0500 Subject: [PATCH 12/22] Remove link --- docs/red_core_data_statement.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/red_core_data_statement.rst b/docs/red_core_data_statement.rst index 17fcba85b..ab7045d35 100644 --- a/docs/red_core_data_statement.rst +++ b/docs/red_core_data_statement.rst @@ -1,5 +1,4 @@ .. Red Core Data Statement -.. _red_core_data_statement: ===================== Red and End User Data From 3b72696bc8274a07d4c7c197ae6a16049bbfba09 Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 2 Dec 2020 16:23:53 -0500 Subject: [PATCH 13/22] Regenerate docs with new code --- docs/cog_guides/core.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 6fb525488..d2f2c6d21 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -1441,7 +1441,7 @@ mydata Commands which interact with the data Red has about you. -More information can be found in the :ref:`End User Data Documentation.` +More information can be found in the :doc:`End User Data Documentation.<../red_core_data_statement>` .. _core-command-mydata-3rdparty: From f3822cdb3ba53ede812e2b8481525479007a3ea7 Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 3 Dec 2020 14:09:58 -0500 Subject: [PATCH 14/22] Some small docstrings --- redbot/core/core_commands.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index e62f530f8..8a172cf20 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1198,8 +1198,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): If public (yes is specified), it will be sent to the chat instead. - Warning: Sending the traceback publicly can accidentally reveal - sensitive information about your computer or configuration. + Warning: Sending the traceback publicly can accidentally reveal sensitive information about your computer or configuration. Examples: - `[p]traceback` - Sends the traceback to your DMs. @@ -1233,6 +1232,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """Shows [botname]'s invite url. This will always send the invite to DMs to keep it private. + + This command is locked to the owner unless `[p]inviteset public` is set to True. """ try: await ctx.author.send(await self._invite_url()) @@ -1300,6 +1301,13 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Please note that you might need two factor authentication for\ some permissions. + + Example: + - `[p]inviteset perms 134217728` - Adds a "Manage Nicknames" permission requirement to the invite. + + **Arguments:** + + - `` The permission level to require for the bot in the generated invite. """ await self.bot._config.invite_perm.set(level) await ctx.send("The new permissions level has been set.") From bc18fff89345d79360b1131cbbfcfed83d3319ec Mon Sep 17 00:00:00 2001 From: bobloy Date: Thu, 3 Dec 2020 14:10:10 -0500 Subject: [PATCH 15/22] Regenerate docs with new .. warning code --- docs/cog_guides/core.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index d2f2c6d21..71bfc6add 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -1125,6 +1125,8 @@ Shows Red's invite url. This will always send the invite to DMs to keep it private. +This command is locked to the owner unless ``[p]inviteset public`` is set to True. + .. _core-command-inviteset: ^^^^^^^^^ @@ -2546,8 +2548,8 @@ Sends to the owner the last command exception that has occurred. If public (yes is specified), it will be sent to the chat instead. -Warning: Sending the traceback publicly can accidentally reveal -sensitive information about your computer or configuration. +.. warning:: Sending the traceback publicly can accidentally reveal sensitive information about your computer or configuration. + Examples: - ``[p]traceback`` - Sends the traceback to your DMs. From bed016e94aeb92e3c7b83a123dbfb9cb627d2705 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 8 Dec 2020 17:36:59 -0500 Subject: [PATCH 16/22] More docstrings into the `set` command --- redbot/core/core_commands.py | 113 ++++++++++++++++++++++++++++++++--- 1 file changed, 106 insertions(+), 7 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 8a172cf20..dac1e0f02 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1316,7 +1316,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.guild_only() @checks.is_owner() async def leave(self, ctx: commands.Context): - """Leaves the current server.""" + """Leaves the current server. + + Note: This command is interactive. + """ await ctx.send(_("Are you sure you want me to leave this server? (y/n)")) pred = MessagePredicate.yes_or_no(ctx) @@ -1666,7 +1669,12 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.command(name="shutdown") @checks.is_owner() async def _shutdown(self, ctx: commands.Context, silently: bool = False): - """Shuts down the bot.""" + """Shuts down the bot. + + Allows [botname] to shut down gracefully. + + This is the recommended method for shutting down the bot. + """ wave = "\N{WAVING HAND SIGN}" skin = "\N{EMOJI MODIFIER FITZPATRICK TYPE-3}" with contextlib.suppress(discord.HTTPException): @@ -1680,8 +1688,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """Attempts to restart [botname]. Makes [botname] quit with exit code 26. - The restart is not guaranteed: it must be dealt - with by the process manager in use.""" + The restart is not guaranteed: it must be dealt with by the process manager in use. + """ with contextlib.suppress(discord.HTTPException): if not silently: await ctx.send(_("Restarting...")) @@ -1689,7 +1697,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.group(name="set") async def _set(self, ctx: commands.Context): - """Changes [botname]'s settings.""" + """Commands for changing [botname]'s settings.""" @_set.command("showsettings") async def set_showsettings(self, ctx: commands.Context): @@ -1761,6 +1769,15 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Set to -1 to disable this feature. This is applied only the current server and not globally. + + Examples: + - `[p]set deletedelay` - Shows the current delete delay setting. + - `[p]set deletedelay 60` - Sets the delete delay to the max of 60 seconds. + - `[p]set deletedelay -1` - Disables deleting command messages. + + **Arguments:** + + - `[time]` The seconds to wait before deleting the command message. Use -1 to disable. """ guild = ctx.guild if time is not None: @@ -1791,7 +1808,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Use without a description to reset. This is shown in a few locations, including the help menu. + The maximum description length is 250 characters to ensure it displays properly. + The default is "Red V3". + + Examples: + - `[p]set description` - Resets the description to the default setting. + - `[p]set description MyBot: A Red V3 Bot` + + **Arguments:** + + - `[time]` The seconds to wait before deleting the command message. Use -1 to disable. """ if not description: await ctx.bot._config.description.clear() @@ -1815,6 +1842,21 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def addadminrole(self, ctx: commands.Context, *, role: discord.Role): """ Adds an admin role for this guild. + + Admins have all the same access and Mods, plus additional admin level commands like: + - `[p]set serverprefix` + - `[p]addrole` + - `[p]ban` + - `[p]ignore guild` + And more. + + Examples: + - `[p]set addadminrole @Admins` + - `[p]set addadminrole Super Admins` + + **Arguments:** + + - `` The role to add as an admin. """ async with ctx.bot._config.guild(ctx.guild).admin_role() as roles: if role.id in roles: @@ -1827,7 +1869,21 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.guild_only() async def addmodrole(self, ctx: commands.Context, *, role: discord.Role): """ - Adds a mod role for this guild. + Adds a moderator role for this guild. + + This grants access to moderator level commands like: + - `[p]mute` + - `[p]cleanup` + - `[p]customcommand create` + And more. + + Examples: + - `[p]set addmodrole @Mods` + - `[p]set addmodrole Loyal Helpers` + + **Arguments:** + + - `` The role to add as a moderator. """ async with ctx.bot._config.guild(ctx.guild).mod_role() as roles: if role.id in roles: @@ -1841,6 +1897,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def removeadminrole(self, ctx: commands.Context, *, role: discord.Role): """ Removes an admin role for this guild. + + Examples: + - `[p]set removeadminrole @Admins` + - `[p]set removeadminrole Super Admins` + + **Arguments:** + + - `` The role to remove from being an admin. """ async with ctx.bot._config.guild(ctx.guild).admin_role() as roles: if role.id not in roles: @@ -1854,6 +1918,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def removemodrole(self, ctx: commands.Context, *, role: discord.Role): """ Removes a mod role for this guild. + + Examples: + - `[p]set removemodrole @Mods` + - `[p]set removemodrole Loyal Helpers` + + **Arguments:** + + - `` The role to remove from being a moderator. """ async with ctx.bot._config.guild(ctx.guild).mod_role() as roles: if role.id not in roles: @@ -1886,6 +1958,10 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Toggle whether to enable fuzzy command search for the server. + This allows the bot to identify potential misspelled commands and offer corrections. + + Note: This can be processor intensive and may be unsuitable for larger servers. + Default is for fuzzy command search to be disabled. """ current_setting = await ctx.bot._config.guild(ctx.guild).fuzzy() @@ -1902,6 +1978,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Toggle whether to enable fuzzy command search in DMs. + This allows the bot to identify potential misspelled commands and offer corrections. + Default is for fuzzy command search to be disabled. """ current_setting = await ctx.bot._config.fuzzy() @@ -1921,6 +1999,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Acceptable values for the colour parameter can be found at: https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.ColourConverter + + Examples: + - `[p]set colour dark red` + - `[p]set colour blurple` + - `[p]set colour 0x5DADE2` + - `[p]set color 0x#FDFEFE` + - `[p]set color #7F8C8D` + + **Arguments:** + + - `[colour]` The colour to use for embeds. Leave blank to set to the default value (red). """ if colour is None: ctx.bot._color = discord.Color.red() @@ -1935,7 +2024,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def avatar(self, ctx: commands.Context, url: str = None): """Sets [botname]'s avatar - Supports either an attachment or an image URL.""" + Supports either an attachment or an image URL. + + Examples: + - `[p]set avatar` - With an image attachment, this will set the avatar. + - `[p]set avatar` - Without an attachment, this will show the command help. + - `[p]set avatar https://links.flaree.xyz/k95` - Sets the avatar to the provided url. + + **Arguments:** + + - `[url]` An image url to be used as an avatar. Leave blank when uploading an attachment. + """ if len(ctx.message.attachments) > 0: # Attachments take priority data = await ctx.message.attachments[0].read() elif url is not None: From 3df617a93f7648ca04a72871e6f1e309587b44bd Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 8 Dec 2020 17:38:20 -0500 Subject: [PATCH 17/22] Bullet lists need blank lines. --- redbot/core/core_commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index dac1e0f02..89adf0410 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -1848,6 +1848,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): - `[p]addrole` - `[p]ban` - `[p]ignore guild` + And more. Examples: @@ -1875,6 +1876,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): - `[p]mute` - `[p]cleanup` - `[p]customcommand create` + And more. Examples: From a7f9a8983df824a0a9c1fb184bc4dc86f8eaddf9 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 8 Dec 2020 17:39:12 -0500 Subject: [PATCH 18/22] Regenerate docs --- docs/cog_guides/core.rst | 123 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 115 insertions(+), 8 deletions(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 71bfc6add..5f923d31c 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -1012,7 +1012,8 @@ helpset verifyexists This allows the bot to respond indicating the existence of a specific help topic even if the user can't use it. -Note: This setting on it's own does not fully prevent command enumeration. +.. Note:: This setting on it's own does not fully prevent command enumeration. + Defaults to False. Using this without a setting will toggle. @@ -1168,6 +1169,13 @@ You can generate one here: https://discordapi.com/permissions.html Please note that you might need two factor authentication for some permissions. +Example: + - ``[p]inviteset perms 134217728`` - Adds a "Manage Nicknames" permission requirement to the invite. + +**Arguments:** + +- ```` The permission level to require for the bot in the generated invite. + .. _core-command-inviteset-public: """""""""""""""" @@ -1211,6 +1219,9 @@ leave Leaves the current server. +.. Note:: This command is interactive. + + .. _core-command-licenseinfo: ^^^^^^^^^^^ @@ -1719,8 +1730,7 @@ restart Attempts to restart Red. Makes Red quit with exit code 26. -The restart is not guaranteed: it must be dealt -with by the process manager in use. +The restart is not guaranteed: it must be dealt with by the process manager in use. .. _core-command-servers: @@ -1740,7 +1750,8 @@ servers Lists and allows Red to leave servers. -Note: This command is interactive. +.. Note:: This command is interactive. + .. _core-command-set: @@ -1756,7 +1767,7 @@ set **Description** -Changes Red's settings. +Commands for changing Red's settings. .. _core-command-set-addadminrole: @@ -1776,6 +1787,21 @@ set addadminrole Adds an admin role for this guild. +Admins have all the same access and Mods, plus additional admin level commands like: + - ``[p]set serverprefix`` + - ``[p]addrole`` + - ``[p]ban`` + - ``[p]ignore guild`` + And more. + + Examples: + - ``[p]set addadminrole @Admins`` + - ``[p]set addadminrole Super Admins`` + +**Arguments:** + +- ```` The role to add as an admin. + .. _core-command-set-addmodrole: """""""""""""" @@ -1792,7 +1818,21 @@ set addmodrole **Description** -Adds a mod role for this guild. +Adds a moderator role for this guild. + +This grants access to moderator level commands like: + - ``[p]mute`` + - ``[p]cleanup`` + - ``[p]customcommand create`` + And more. + + Examples: + - ``[p]set addmodrole @Mods`` + - ``[p]set addmodrole Loyal Helpers`` + +**Arguments:** + +- ```` The role to add as a moderator. .. _core-command-set-api: @@ -1817,7 +1857,8 @@ 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 list of key,values as described by the cog requesting this command. -Note: API tokens are sensitive and should only be used in a private channel +.. Note:: API tokens are sensitive and should only be used in a private channel + or in DM with the bot. .. _core-command-set-api-list: @@ -1874,6 +1915,15 @@ Sets Red's avatar Supports either an attachment or an image URL. +Examples: + - ``[p]set avatar`` - With an image attachment, this will set the avatar. + - ``[p]set avatar`` - Without an attachment, this will show the command help. + - ``[p]set avatar https://links.flaree.xyz/k95`` - Sets the avatar to the provided url. + +**Arguments:** + +- ``[url]`` A url to an image to be used as an avatar. Leave blank when uploading an attachment. + .. _core-command-set-avatar-remove: """"""""""""""""" @@ -1918,6 +1968,17 @@ Acceptable values for the colour parameter can be found at: https://discordpy.readthedocs.io/en/stable/ext/commands/api.html#discord.ext.commands.ColourConverter +Examples: + - ``[p]set colour dark red`` + - ``[p]set colour blurple`` + - ``[p]set colour 0x5DADE2`` + - ``[p]set color 0x#FDFEFE`` + - ``[p]set color #7F8C8D`` + +**Arguments:** + +- ``[colour]`` The colour to use for embeds. Leave blank to set to the default value (red). + .. _core-command-set-competing: """"""""""""" @@ -1983,6 +2044,15 @@ Set to -1 to disable this feature. This is applied only the current server and not globally. +Examples: + - ``[p]set deletedelay`` - Shows the current delete delay setting. + - ``[p]set deletedelay 60`` - Sets the delete delay to the max of 60 seconds. + - ``[p]set deletedelay -1`` - Disables deleting command messages. + +**Arguments:** + +- ``[time]`` The seconds to wait before deleting the command message. Use -1 to disable. + .. _core-command-set-description: """"""""""""""" @@ -2003,8 +2073,18 @@ Sets the bot's description. Use without a description to reset. This is shown in a few locations, including the help menu. +The maximum description length is 250 characters to ensure it displays properly. + The default is "Red V3". +Examples: + - ``[p]set description`` - Resets the description to the default setting. + - ``[p]set description MyBot: A Red V3 Bot`` + +**Arguments:** + +- ``[time]`` The seconds to wait before deleting the command message. Use -1 to disable. + .. _core-command-set-fuzzy: """"""""" @@ -2023,6 +2103,8 @@ set fuzzy Toggle whether to enable fuzzy command search in DMs. +This allows the bot to identify potential misspelled commands and offer corrections. + Default is for fuzzy command search to be disabled. .. _core-command-set-globallocale: @@ -2327,6 +2409,14 @@ set removeadminrole Removes an admin role for this guild. +Examples: + - ``[p]set removeadminrole @Admins`` + - ``[p]set removeadminrole Super Admins`` + +**Arguments:** + +- ```` The role to remove from being an admin. + .. _core-command-set-removemodrole: """"""""""""""""" @@ -2347,6 +2437,14 @@ set removemodrole Removes a mod role for this guild. +Examples: + - ``[p]set removemodrole @Mods`` + - ``[p]set removemodrole Loyal Helpers`` + +**Arguments:** + +- ```` The role to remove from being a moderator. + .. _core-command-set-serverfuzzy: """"""""""""""" @@ -2365,6 +2463,11 @@ set serverfuzzy Toggle whether to enable fuzzy command search for the server. +This allows the bot to identify potential misspelled commands and offer corrections. + +.. Note:: This can be processor intensive and may be unsuitable for larger servers. + + Default is for fuzzy command search to be disabled. .. _core-command-set-serverprefix: @@ -2528,6 +2631,10 @@ shutdown Shuts down the bot. +Allows Red to shut down gracefully. + +This is the recommended method for shutting down the bot. + .. _core-command-traceback: ^^^^^^^^^ @@ -2548,7 +2655,7 @@ Sends to the owner the last command exception that has occurred. If public (yes is specified), it will be sent to the chat instead. -.. warning:: Sending the traceback publicly can accidentally reveal sensitive information about your computer or configuration. +.. Warning:: Sending the traceback publicly can accidentally reveal sensitive information about your computer or configuration. Examples: From 4f3d89fc566001a71177a61c6bd870a6c13501cd Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 8 Dec 2020 17:40:57 -0500 Subject: [PATCH 19/22] Regenerate docs (fix bullet lists) --- docs/cog_guides/core.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 5f923d31c..1f5689d50 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -1792,6 +1792,7 @@ Admins have all the same access and Mods, plus additional admin level commands l - ``[p]addrole`` - ``[p]ban`` - ``[p]ignore guild`` + And more. Examples: @@ -1824,6 +1825,7 @@ This grants access to moderator level commands like: - ``[p]mute`` - ``[p]cleanup`` - ``[p]customcommand create`` + And more. Examples: @@ -1922,7 +1924,7 @@ Examples: **Arguments:** -- ``[url]`` A url to an image to be used as an avatar. Leave blank when uploading an attachment. +- ``[url]`` An image url to be used as an avatar. Leave blank when uploading an attachment. .. _core-command-set-avatar-remove: From 7655cefdcd538c77d98a7fc2b30a58924d461b22 Mon Sep 17 00:00:00 2001 From: bobloy Date: Wed, 9 Dec 2020 10:49:55 -0500 Subject: [PATCH 20/22] set activity statuses docstrings --- redbot/core/core_commands.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 89adf0410..04f546114 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -2083,7 +2083,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.bot_in_a_guild() @checks.is_owner() async def _game(self, ctx: commands.Context, *, game: str = None): - """Sets [botname]'s playing status.""" + """Sets [botname]'s playing status. + + Maximum length for a playing status is 128 characters. + + Examples: + - `[p]set playing` - Clears the activity status. + - `[p]set playing the keyboard` + + **Arguments:** + + - `[game]` The text to follow `playing`. Leave blank to clear the current activity status. + """ if game: if len(game) > 128: @@ -2103,7 +2114,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.bot_in_a_guild() @checks.is_owner() async def _listening(self, ctx: commands.Context, *, listening: str = None): - """Sets [botname]'s listening status.""" + """Sets [botname]'s listening status. + + Maximum length for a listening status is 128 characters. + + Examples: + - `[p]set playing` - Clears the activity status. + - `[p]set playing the keyboard` + + **Arguments:** + + - `[game]` The text to follow `playing`. Leave blank to clear the current activity status.""" status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online if listening: From ca04ac47785b48a8635300eed36f628dddb72011 Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 11 Dec 2020 17:56:38 -0500 Subject: [PATCH 21/22] Docstrings up to helpset pagecharlimit --- redbot/core/core_commands.py | 296 +++++++++++++++++++++++++++++------ 1 file changed, 250 insertions(+), 46 deletions(-) diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 04f546114..ee1b36be1 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -2085,6 +2085,8 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def _game(self, ctx: commands.Context, *, game: str = None): """Sets [botname]'s playing status. + This will appear as `Playing ` or `PLAYING A GAME: ` depending on the context. + Maximum length for a playing status is 128 characters. Examples: @@ -2093,7 +2095,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): **Arguments:** - - `[game]` The text to follow `playing`. Leave blank to clear the current activity status. + - `[game]` The text to follow `Playing`. Leave blank to clear the current activity status. """ if game: @@ -2116,15 +2118,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def _listening(self, ctx: commands.Context, *, listening: str = None): """Sets [botname]'s listening status. + This will appear as `Listening to `. + Maximum length for a listening status is 128 characters. Examples: - - `[p]set playing` - Clears the activity status. - - `[p]set playing the keyboard` + - `[p]set listening` - Clears the activity status. + - `[p]set listening jams` **Arguments:** - - `[game]` The text to follow `playing`. Leave blank to clear the current activity status.""" + - `[listening]` The text to follow `Listening to`. Leave blank to clear the current activity status.""" status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online if listening: @@ -2143,7 +2147,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.bot_in_a_guild() @checks.is_owner() async def _watching(self, ctx: commands.Context, *, watching: str = None): - """Sets [botname]'s watching status.""" + """Sets [botname]'s watching status. + + This will appear as `Watching `. + + Maximum length for a watching status is 128 characters. + + Examples: + - `[p]set watching` - Clears the activity status. + - `[p]set watching [p]help` + + **Arguments:** + + - `[watching]` The text to follow `Watching`. Leave blank to clear the current activity status.""" status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online if watching: @@ -2160,7 +2176,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.bot_in_a_guild() @checks.is_owner() async def _competing(self, ctx: commands.Context, *, competing: str = None): - """Sets [botname]'s competing status.""" + """Sets [botname]'s competing status. + + This will appear as `Competing in `. + + Maximum length for a competing status is 128 characters. + + Examples: + - `[p]set competing` - Clears the activity status. + - `[p]set competing London 2012 Olympic Games` + + **Arguments:** + + - `[competing]` The text to follow `Competing in`. Leave blank to clear the current activity status.""" status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else discord.Status.online if competing: @@ -2182,10 +2210,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """Sets [botname]'s status. Available statuses: - online - idle - dnd - invisible + - `online` + - `idle` + - `dnd` + - `invisible` + + Examples: + - `[p]set status online` - Clears the activity status. + - `[p]set status invisible` + + **Arguments:** + + - `` One of the available statuses. """ statuses = { @@ -2210,7 +2246,21 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def stream(self, ctx: commands.Context, streamer=None, *, stream_title=None): """Sets [botname]'s streaming status. - Leaving both streamer and stream_title empty will clear it.""" + This will appear as `Streaming ` or `LIVE ON TWITCH` depending on the context. + It will also include a `Watch` button with a twitch.tv url for the provided streamer. + + Maximum length for a stream title is 128 characters. + + Leaving both streamer and stream_title empty will clear it. + + Examples: + - `[p]set competing` - Clears the activity status. + - `[p]set competing London 2012 Olympic Games` + + **Arguments:** + + - `[streamer]` The twitch streamer to provide a link to. This can be their twitch name or the entire URL. + - `[stream_title]` The text to follow `Streaming` in the status.""" status = ctx.bot.guilds[0].me.status if len(ctx.bot.guilds) > 0 else None @@ -2230,7 +2280,20 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @_set.command(name="username", aliases=["name"]) @checks.is_owner() async def _username(self, ctx: commands.Context, *, username: str): - """Sets [botname]'s username.""" + """Sets [botname]'s username. + + Maximum length for a username is 32 characters. + + Note: The username of a verified bot cannot be manually changed. + Please contact Discord support to change it. + + Example: + - `[p]set username BaguetteBot` + + **Arguments:** + + - `` The username to give the bot. + """ try: if self.bot.user.public_flags.verified_bot: await ctx.send( @@ -2275,7 +2338,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.admin_or_permissions(manage_nicknames=True) @commands.guild_only() async def _nickname(self, ctx: commands.Context, *, nickname: str = None): - """Sets [botname]'s nickname.""" + """Sets [botname]'s nickname for the current server. + + Maximum length for a nickname is 32 characters. + + Example: + - `[p]set username 🎃 SpookyBot 🎃` + + **Arguments:** + + - `[nickname]` The nickname to give the bot. Leave blank to clear the current nickname. + """ try: if nickname and len(nickname) > 32: await ctx.send(_("Failed to change nickname. Must be 32 characters or fewer.")) @@ -2289,7 +2362,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @_set.command(aliases=["prefixes"]) @checks.is_owner() async def prefix(self, ctx: commands.Context, *prefixes: str): - """Sets [botname]'s global prefix(es).""" + """Sets [botname]'s global prefix(es). + + Warning: This is not additive. It will replace all current prefixes. + + Examples: + - `[p]set prefix !` + - `[p]set prefix "@[botname] "` - Quotes are needed to use spaces. This uses a mention as the prefix. + - `[p]set prefix ! ? .` - Sets multiple prefixes. + + **Arguments:** + + - `[prefixes...]` The prefixes the bot will respond to globally. + """ if not prefixes: await ctx.send_help() return @@ -2300,7 +2385,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @checks.admin_or_permissions(manage_guild=True) @commands.guild_only() async def serverprefix(self, ctx: commands.Context, *prefixes: str): - """Sets [botname]'s server prefix(es).""" + """Sets [botname]'s server prefix(es). + + Warning: This will override global prefixes, the bot will not respond to any global prefixes in this server. + This is not additive. It will replace all current server prefixes. + + Examples: + - `[p]set serverprefix !` + - `[p]set serverprefix "@[botname] "` - Quotes are needed to use spaces. This uses a mention as the prefix. + - `[p]set serverprefix ! ? .` - Sets multiple prefixes. + + **Arguments:** + + - `[prefixes...]` The prefixes the bot will respond to on this server. Leave blank to clear server prefixes""" if not prefixes: await ctx.bot.set_prefixes(guild=ctx.guild, prefixes=[]) await ctx.send(_("Guild prefixes have been reset.")) @@ -2314,15 +2411,22 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def globallocale(self, ctx: commands.Context, language_code: str): """ Changes the bot's default locale. + This will be used when a server has not set a locale, or in DMs. - `` can be any language code with country code included, - e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. - - Go to Red's Crowdin page to see locales that are available with translations: - https://translate.discord.red + Go to [Red's Crowdin page](https://translate.discord.red) to see locales that are available with translations. To reset to English, use "en-US". + + Examples: + - `[p]set locale en-US` + - `[p]set locale de-DE` + - `[p]set locale fr-FR` + - `[p]set locale pl-PL` + + **Arguments:** + + - `` The default locale to use for the bot. This can be any language code with country code included. """ try: locale = BabelLocale.parse(language_code, sep="-") @@ -2347,14 +2451,21 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Changes the bot's locale in this server. - `` can be any language code with country code included, - e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. - - Go to Red's Crowdin page to see locales that are available with translations: - https://translate.discord.red + Go to [Red's Crowdin page](https://translate.discord.red) to see locales that are available with translations. Use "default" to return to the bot's default set language. To reset to English, use "en-US". + + Examples: + - `[p]set locale en-US` + - `[p]set locale de-DE` + - `[p]set locale fr-FR` + - `[p]set locale pl-PL` + - `[p]set locale default` - Resets to the global default locale. + + **Arguments:** + + - `` The default locale to use for the bot. This can be any language code with country code included. """ if language_code.lower() == "default": global_locale = await self.bot._config.locale() @@ -2384,10 +2495,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Changes bot's regional format. This is used for formatting date, time and numbers. - `` can be any language code with country code included, - e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. + `language_code` can be any language code with country code included, e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. + Leave `language_code` empty to base regional formatting on bot's locale. - Leave `` empty to base regional formatting on bot's locale. + Examples: + - `[p]set globalregionalformat en-US` + - `[p]set globalregion de-DE` + - `[p]set globalregionalformat` - Resets to the locale. + + **Arguments:** + + - `[language_code]` The default region format to use for the bot. """ if language_code is None: i18n.set_regional_format(None) @@ -2420,10 +2538,17 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): """ Changes bot's regional format in this server. This is used for formatting date, time and numbers. - `` can be any language code with country code included, - e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. + `language_code` can be any language code with country code included, e.g. `en-US`, `de-DE`, `fr-FR`, `pl-PL`, etc. + Leave `language_code` empty to base regional formatting on bot's locale in this server. - Leave `` empty to base regional formatting on bot's locale in this server. + Examples: + - `[p]set regionalformat en-US` + - `[p]set region de-DE` + - `[p]set regionalformat` - Resets to the locale. + + **Arguments:** + + - `[language_code]` The region format to use for the bot in this server. """ if language_code is None: i18n.set_contextual_regional_format(None) @@ -2459,8 +2584,19 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): The maximum amount of allowed characters is 1024. Supports markdown, links and "mentions". - Link example: - `[My link](https://example.com)` + + Link example: `[My link](https://example.com)` + + Examples: + - `[p]set custominfo >>> I can use **markdown** like quotes + and ~~multiple~~ lines` + - `[p]set custominfo Join my [support server](discord.gg/discord) + Or send me 🍪` + - `[p]set custominfo` - Removes custom info text. + + **Arguments:** + + - `[text]` The custom info text. """ if not text: await ctx.bot._config.custom_info.clear() @@ -2476,15 +2612,23 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @_set.group(invoke_without_command=True) @checks.is_owner() async def api(self, ctx: commands.Context, service: str, *, tokens: TokenConverter): - """Set, list or remove various external API tokens. + """Commands to set, list or remove 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 list of key,values as described by the cog requesting this command. - Note: API tokens are sensitive and should only be used in a private channel - or in DM with the bot. + Note: API tokens are sensitive and should only be used in a private channel or in DM with the bot. + + Examples: + - `[p]set api Spotify redirect_uri localhost` + - `[p]set api github client_id,whoops client_secret,whoops` + + **Arguments:** + + - `` The service you're adding tokens to. + - `` Pairs of token keys and values. The key and value should be separated by one of ` `, `,`, or `;`. """ if ctx.channel.permissions_for(ctx.me).manage_messages: await ctx.message.delete() @@ -2514,7 +2658,15 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @api.command(name="remove") async def api_remove(self, ctx: commands.Context, *services: str): - """Remove the given services with all their keys and tokens.""" + """Remove the given services with all their keys and tokens. + + Examples: + - `[p]set api remove Spotify` + - `[p]set api remove github audiodb` + + **Arguments:** + + - `[services...]` The services to remove.""" bot_services = (await ctx.bot.get_shared_api_tokens()).keys() services = [s for s in services if s in bot_services] @@ -2535,12 +2687,15 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @commands.group() @checks.is_owner() async def helpset(self, ctx: commands.Context): - """Manage settings for the help command.""" + """Commands to manage settings for the help command.""" pass @helpset.command(name="showsettings") async def helpset_showsettings(self, ctx: commands.Context): - """ Show the current help settings. """ + """Show the current help settings. + + Warning: These setting may not be accurate if the default formatter is not in use. + """ help_settings = await commands.help.HelpSettings.from_context(ctx) @@ -2557,7 +2712,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @helpset.command(name="resetformatter") async def helpset_resetformatter(self, ctx: commands.Context): - """ This resets [botname]'s help formatter to the default formatter. """ + """This resets [botname]'s help formatter to the default formatter.""" ctx.bot.reset_help_formatter() await ctx.send( @@ -2589,8 +2744,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Allows the help command to be sent as a paginated menu instead of separate messages. + When enabled, `[p]help` will only show one page at a time and use reactions to navigate to other pages. + This defaults to False. Using this without a setting will toggle. + + Examples: + - `[p]helpset usemenues False` - Disables using menus on this server. + - `[p]helpset usemenues` - Toggles the value. + + **Arguments:** + + - `[use_menus]` Whether to use menus on this server. Leave blank to toggle. """ if use_menus is None: use_menus = not await ctx.bot._config.help.use_menus() @@ -2607,6 +2772,14 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): This defaults to False. Using this without a setting will toggle. + + Examples: + - `[p]helpset showhidden False` - Disables embeds on this server. + - `[p]helpset showhidden` - Toggles the value. + + **Arguments:** + + - `[show_hidden]` Whether to use embeds on this server. Leave blank to toggle. """ if show_hidden is None: show_hidden = not await ctx.bot._config.help.show_hidden() @@ -2623,6 +2796,16 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): Defaults to False. Using this without a setting will toggle. + + Note: This is only used when the bot is not using menus. + + Examples: + - `[p]helpset usetick False` - Disables ticking in DMs. + - `[p]helpset usetick` - Toggles the value. + + **Arguments:** + + - `[use_tick]` Whether to tick the help command in DMs. Leave blank to toggle. """ if use_tick is None: use_tick = not await ctx.bot._config.help.use_tick() @@ -2635,11 +2818,18 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @helpset.command(name="verifychecks") async def helpset_permfilter(self, ctx: commands.Context, verify: bool = None): """ - Sets if commands which can't be run in the current context should be - filtered from help. + Sets if commands which can't be run in the current context should be filtered from help. Defaults to True. Using this without a setting will toggle. + + Examples: + - `[p]helpset verifychecks False` - Enables showing unusable commands. + - `[p]helpset verifychecks` - Toggles the value. + + **Arguments:** + + - `[verify]` Whether to hide unusable commands in help. Leave blank to toggle. """ if verify is None: verify = not await ctx.bot._config.help.verify_checks() @@ -2652,13 +2842,20 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): @helpset.command(name="verifyexists") async def helpset_verifyexists(self, ctx: commands.Context, verify: bool = None): """ - This allows the bot to respond indicating the existence of a specific - help topic even if the user can't use it. + This allows the bot to respond indicating the existence of a specific help topic even if the user can't use it. Note: This setting on it's own does not fully prevent command enumeration. Defaults to False. Using this without a setting will toggle. + + Examples: + - `[p]helpset verifyexists False` - Enables showing unusable commands. + - `[p]helpset verifyexists` - Toggles the value. + + **Arguments:** + + - `[verify]` Whether to hide unusable commands in help. Leave blank to toggle. """ if verify is None: verify = not await ctx.bot._config.help.verify_exists() @@ -2677,13 +2874,20 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def helpset_pagecharlimt(self, ctx: commands.Context, limit: int): """Set the character limit for each page in the help message. - This setting only applies to embedded help. + Note: This setting only applies to embedded help. The default value is 1000 characters. The minimum value is 500. The maximum is based on the lower of what you provide and what discord allows. Please note that setting a relatively small character limit may mean some pages will exceed this limit. + + Example: + - `[p]helpset pagecharlimit 1500` + + **Arguments:** + + - `` The max amount of characters to show per page in the help message. """ if limit < 500: await ctx.send(_("You must give a value of at least 500 characters.")) @@ -2696,7 +2900,7 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic): async def helpset_maxpages(self, ctx: commands.Context, pages: int): """Set the maximum number of help pages sent in a server channel. - This setting does not apply to menu help. + Note: This setting does not apply to menu help. If a help message contains more pages than this value, the help message will be sent to the command author via DM. This is to help reduce spam in server From 29540c66e788224b5de39fcda6ccbbe562bc48fe Mon Sep 17 00:00:00 2001 From: bobloy Date: Fri, 11 Dec 2020 17:56:51 -0500 Subject: [PATCH 22/22] Regenerate docs --- docs/cog_guides/core.rst | 297 ++++++++++++++++++++++++++++++++++----- 1 file changed, 262 insertions(+), 35 deletions(-) diff --git a/docs/cog_guides/core.rst b/docs/cog_guides/core.rst index 1f5689d50..fe7390bcb 100644 --- a/docs/cog_guides/core.rst +++ b/docs/cog_guides/core.rst @@ -776,7 +776,7 @@ helpset **Description** -Manage settings for the help command. +Commands to manage settings for the help command. .. _core-command-helpset-deletedelay: @@ -816,7 +816,8 @@ helpset maxpages Set the maximum number of help pages sent in a server channel. -This setting does not apply to menu help. +.. Note:: This setting does not apply to menu help. + If a help message contains more pages than this value, the help message will be sent to the command author via DM. This is to help reduce spam in server @@ -840,7 +841,8 @@ helpset pagecharlimit Set the character limit for each page in the help message. -This setting only applies to embedded help. +.. Note:: This setting only applies to embedded help. + The default value is 1000 characters. The minimum value is 500. The maximum is based on the lower of what you provide and what discord allows. @@ -848,6 +850,13 @@ The maximum is based on the lower of what you provide and what discord allows. Please note that setting a relatively small character limit may mean some pages will exceed this limit. +Example: + - ``[p]helpset pagecharlimit 1500`` + +**Arguments:** + +- ```` The max amount of characters to show per page in the help message. + .. _core-command-helpset-resetformatter: """""""""""""""""""""" @@ -862,7 +871,7 @@ helpset resetformatter **Description** -This resets Red's help formatter to the default formatter. +This resets Red's help formatter to the default formatter. .. _core-command-helpset-resetsettings: @@ -901,6 +910,14 @@ This allows the help command to show hidden commands. This defaults to False. Using this without a setting will toggle. +Examples: + - ``[p]helpset showhidden False`` - Disables embeds on this server. + - ``[p]helpset showhidden`` - Toggles the value. + +**Arguments:** + +- ``[show_hidden]`` Whether to use embeds on this server. Leave blank to toggle. + .. _core-command-helpset-showsettings: """""""""""""""""""" @@ -915,7 +932,10 @@ helpset showsettings **Description** -Show the current help settings. +Show the current help settings. + +.. Warning:: These setting may not be accurate if the default formatter is not in use. + .. _core-command-helpset-tagline: @@ -953,9 +973,19 @@ helpset usemenus Allows the help command to be sent as a paginated menu instead of separate messages. +When enabled, ``[p]help`` will only show one page at a time and use reactions to navigate to other pages. + This defaults to False. Using this without a setting will toggle. + Examples: + - ``[p]helpset usemenues False`` - Disables using menus on this server. + - ``[p]helpset usemenues`` - Toggles the value. + +**Arguments:** + +- ``[use_menus]`` Whether to use menus on this server. Leave blank to toggle. + .. _core-command-helpset-usetick: """"""""""""""" @@ -975,6 +1005,17 @@ This allows the help command message to be ticked if help is sent in a DM. Defaults to False. Using this without a setting will toggle. +.. Note:: This is only used when the bot is not using menus. + + +Examples: + - ``[p]helpset usetick False`` - Disables ticking in DMs. + - ``[p]helpset usetick`` - Toggles the value. + +**Arguments:** + +- ``[use_tick]`` Whether to tick the help command in DMs. Leave blank to toggle. + .. _core-command-helpset-verifychecks: """""""""""""""""""" @@ -989,12 +1030,19 @@ helpset verifychecks **Description** -Sets if commands which can't be run in the current context should be -filtered from help. +Sets if commands which can't be run in the current context should be filtered from help. Defaults to True. Using this without a setting will toggle. +Examples: + - ``[p]helpset verifychecks False`` - Enables showing unusable commands. + - ``[p]helpset verifychecks`` - Toggles the value. + +**Arguments:** + +- ``[verify]`` Whether to hide unusable commands in help. Leave blank to toggle. + .. _core-command-helpset-verifyexists: """""""""""""""""""" @@ -1009,8 +1057,7 @@ helpset verifyexists **Description** -This allows the bot to respond indicating the existence of a specific -help topic even if the user can't use it. +This allows the bot to respond indicating the existence of a specific help topic even if the user can't use it. .. Note:: This setting on it's own does not fully prevent command enumeration. @@ -1018,6 +1065,14 @@ help topic even if the user can't use it. Defaults to False. Using this without a setting will toggle. +Examples: + - ``[p]helpset verifyexists False`` - Enables showing unusable commands. + - ``[p]helpset verifyexists`` - Toggles the value. + +**Arguments:** + +- ``[verify]`` Whether to hide unusable commands in help. Leave blank to toggle. + .. _core-command-ignore: ^^^^^^ @@ -1852,16 +1907,24 @@ set api **Description** -Set, list or remove various external API tokens. +Commands to set, list or remove 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 list of key,values as described by the cog requesting this command. -.. Note:: API tokens are sensitive and should only be used in a private channel +.. Note:: API tokens are sensitive and should only be used in a private channel or in DM with the bot. -or in DM with the bot. + +Examples: + - ``[p]set api Spotify redirect_uri localhost`` + - ``[p]set api github client_id,whoops client_secret,whoops`` + +**Arguments:** + +- ```` The service you're adding tokens to. +- ```` Pairs of token keys and values. The key and value should be separated by one of `` ``, ``,``, or ``;``. .. _core-command-set-api-list: @@ -1897,6 +1960,14 @@ set api remove Remove the given services with all their keys and tokens. +Examples: + - ``[p]set api remove Spotify`` + - ``[p]set api remove github audiodb`` + +**Arguments:** + +- ``[services...]`` The services to remove. + .. _core-command-set-avatar: """""""""" @@ -1999,6 +2070,18 @@ set competing Sets Red's competing status. +This will appear as ``Competing in ``. + +Maximum length for a competing status is 128 characters. + +Examples: + - ``[p]set competing`` - Clears the activity status. + - ``[p]set competing London 2012 Olympic Games`` + +**Arguments:** + +- ``[competing]`` The text to follow ``Competing in``. Leave blank to clear the current activity status. + .. _core-command-set-custominfo: """""""""""""" @@ -2019,8 +2102,19 @@ Customizes a section of ``[p]info``. The maximum amount of allowed characters is 1024. Supports markdown, links and "mentions". -Link example: -```My link `_`` + +Link example: ``[My link](https://example.com)`` + +Examples: + - ``[p]set custominfo >>> I can use **markdown** like quotes + and ~~multiple~~ lines`` + - ``[p]set custominfo Join my [support server](discord.gg/discord) + Or send me 🍪`` + - ``[p]set custominfo`` - Removes custom info text. + +**Arguments:** + +- ``[text]`` The custom info text. .. _core-command-set-deletedelay: @@ -2126,16 +2220,23 @@ set globallocale **Description** Changes the bot's default locale. + This will be used when a server has not set a locale, or in DMs. -```` can be any language code with country code included, -e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. - -Go to Red's Crowdin page to see locales that are available with translations: -https://translate.discord.red +Go to `Red's Crowdin page `_ to see locales that are available with translations. To reset to English, use "en-US". +Examples: + - ``[p]set locale en-US`` + - ``[p]set locale de-DE`` + - ``[p]set locale fr-FR`` + - ``[p]set locale pl-PL`` + +**Arguments:** + +- ```` The default locale to use for the bot. This can be any language code with country code included. + .. _core-command-set-globalregionalformat: """""""""""""""""""""""" @@ -2156,10 +2257,17 @@ set globalregionalformat Changes bot's regional format. This is used for formatting date, time and numbers. -```` can be any language code with country code included, -e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. +``language_code`` can be any language code with country code included, e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. +Leave ``language_code`` empty to base regional formatting on bot's locale. -Leave ```` empty to base regional formatting on bot's locale. +Examples: + - ``[p]set globalregionalformat en-US`` + - ``[p]set globalregion de-DE`` + - ``[p]set globalregionalformat`` - Resets to the locale. + +**Arguments:** + +- ``[language_code]`` The default region format to use for the bot. .. _core-command-set-listening: @@ -2179,6 +2287,18 @@ set listening Sets Red's listening status. +This will appear as ``Listening to ``. + +Maximum length for a listening status is 128 characters. + +Examples: + - ``[p]set listening`` - Clears the activity status. + - ``[p]set listening jams`` + +**Arguments:** + +- ``[listening]`` The text to follow ``Listening to``. Leave blank to clear the current activity status. + .. _core-command-set-locale: """""""""" @@ -2197,15 +2317,22 @@ set locale Changes the bot's locale in this server. -```` can be any language code with country code included, -e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. - -Go to Red's Crowdin page to see locales that are available with translations: -https://translate.discord.red +Go to `Red's Crowdin page `_ to see locales that are available with translations. Use "default" to return to the bot's default set language. To reset to English, use "en-US". +Examples: + - ``[p]set locale en-US`` + - ``[p]set locale de-DE`` + - ``[p]set locale fr-FR`` + - ``[p]set locale pl-PL`` + - ``[p]set locale default`` - Resets to the global default locale. + +**Arguments:** + +- ```` The default locale to use for the bot. This can be any language code with country code included. + .. _core-command-set-nickname: """""""""""" @@ -2222,7 +2349,16 @@ set nickname **Description** -Sets Red's nickname. +Sets Red's nickname for the current server. + +Maximum length for a nickname is 32 characters. + +Example: + - ``[p]set username 🎃 SpookyBot 🎃`` + +**Arguments:** + +- ``[nickname]`` The nickname to give the bot. Leave blank to clear the current nickname. .. _core-command-set-ownernotifications: @@ -2346,6 +2482,18 @@ set playing Sets Red's playing status. +This will appear as ``Playing `` or ``PLAYING A GAME: `` depending on the context. + +Maximum length for a playing status is 128 characters. + +Examples: + - ``[p]set playing`` - Clears the activity status. + - ``[p]set playing the keyboard`` + +**Arguments:** + +- ``[game]`` The text to follow ``Playing``. Leave blank to clear the current activity status. + .. _core-command-set-prefix: """""""""" @@ -2366,6 +2514,18 @@ set prefix Sets Red's global prefix(es). +.. Warning:: This is not additive. It will replace all current prefixes. + + +Examples: + - ``[p]set prefix !`` + - ``[p]set prefix "@Red "`` - Quotes are needed to use spaces. This uses a mention as the prefix. + - ``[p]set prefix ! ? .`` - Sets multiple prefixes. + +**Arguments:** + +- ``[prefixes...]`` The prefixes the bot will respond to globally. + .. _core-command-set-regionalformat: """""""""""""""""" @@ -2386,10 +2546,17 @@ set regionalformat Changes bot's regional format in this server. This is used for formatting date, time and numbers. -```` can be any language code with country code included, -e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. +``language_code`` can be any language code with country code included, e.g. ``en-US``, ``de-DE``, ``fr-FR``, ``pl-PL``, etc. +Leave ``language_code`` empty to base regional formatting on bot's locale in this server. -Leave ```` empty to base regional formatting on bot's locale in this server. +Examples: + - ``[p]set regionalformat en-US`` + - ``[p]set region de-DE`` + - ``[p]set regionalformat`` - Resets to the locale. + +**Arguments:** + +- ``[language_code]`` The region format to use for the bot in this server. .. _core-command-set-removeadminrole: @@ -2492,6 +2659,19 @@ set serverprefix Sets Red's server prefix(es). +.. Warning:: This will override global prefixes, the bot will not respond to any global prefixes in this server. + + This is not additive. It will replace all current server prefixes. + +Examples: + - ``[p]set serverprefix !`` + - ``[p]set serverprefix "@Red "`` - Quotes are needed to use spaces. This uses a mention as the prefix. + - ``[p]set serverprefix ! ? .`` - Sets multiple prefixes. + +**Arguments:** + +- ``[prefixes...]`` The prefixes the bot will respond to on this server. Leave blank to clear server prefixes + .. _core-command-set-showsettings: """""""""""""""" @@ -2527,10 +2707,18 @@ set status Sets Red's status. Available statuses: - online - idle - dnd - invisible + - ``online`` + - ``idle`` + - ``dnd`` + - ``invisible`` + +Examples: + - ``[p]set status online`` - Clears the activity status. + - ``[p]set status invisible`` + +**Arguments:** + +- ```` One of the available statuses. .. _core-command-set-streaming: @@ -2552,8 +2740,22 @@ set streaming Sets Red's streaming status. +This will appear as ``Streaming `` or ``LIVE ON TWITCH`` depending on the context. +It will also include a ``Watch`` button with a twitch.tv url for the provided streamer. + +Maximum length for a stream title is 128 characters. + Leaving both streamer and stream_title empty will clear it. +Examples: + - ``[p]set competing`` - Clears the activity status. + - ``[p]set competing London 2012 Olympic Games`` + +**Arguments:** + +- ``[streamer]`` The twitch streamer to provide a link to. This can be their twitch name or the entire URL. +- ``[stream_title]`` The text to follow ``Streaming`` in the status. + .. _core-command-set-usebotcolour: """""""""""""""" @@ -2597,6 +2799,19 @@ set username Sets Red's username. +Maximum length for a username is 32 characters. + +.. Note:: The username of a verified bot cannot be manually changed. + + Please contact Discord support to change it. + +Example: + - ``[p]set username BaguetteBot`` + +**Arguments:** + +- ```` The username to give the bot. + .. _core-command-set-watching: """""""""""" @@ -2615,6 +2830,18 @@ set watching Sets Red's watching status. +This will appear as ``Watching ``. + +Maximum length for a watching status is 128 characters. + +Examples: + - ``[p]set watching`` - Clears the activity status. + - ``[p]set watching [p]help`` + +**Arguments:** + +- ``[watching]`` The text to follow ``Watching``. Leave blank to clear the current activity status. + .. _core-command-shutdown: ^^^^^^^^