@@ -733,11 +733,14 @@ async def config(self, ctx):
733733 Type `{prefix}config options` to view a list
734734 of valid configuration variables.
735735
736+ Type `{prefix}config help config-name` for info
737+ on a config.
738+
736739 To set a configuration variable:
737- - `{prefix}config set varname value here`
740+ - `{prefix}config set config-name value here`
738741
739742 To remove a configuration variable:
740- - `{prefix}config remove varname `
743+ - `{prefix}config remove config-name `
741744 """
742745 await ctx .send_help (ctx .command )
743746
@@ -849,6 +852,52 @@ async def config_get(self, ctx, key: str.lower = None):
849852
850853 return await ctx .send (embed = embed )
851854
855+ @config .command (name = "help" , aliases = ["info" ])
856+ @checks .has_permissions (PermissionLevel .OWNER )
857+ async def config_help (self , ctx , key : str .lower ):
858+ """
859+ Show information on a specified configuration.
860+ """
861+ if key not in self .bot .config .public_keys :
862+ embed = Embed (
863+ title = "Error" ,
864+ color = Color .red (),
865+ description = f"`{ key } ` is an invalid key." ,
866+ )
867+ return await ctx .send (embed = embed )
868+
869+ config_help = self .bot .config .config_help
870+ info = config_help .get (key )
871+
872+ if info is None :
873+ embed = Embed (
874+ title = "Error" ,
875+ color = Color .red (),
876+ description = f"No help details found for `{ key } `." ,
877+ )
878+ return await ctx .send (embed = embed )
879+
880+ def fmt (val ):
881+ return val .format (prefix = self .bot .prefix , bot = self .bot )
882+
883+ embed = Embed (
884+ title = f"Configuration description on { key } :" ,
885+ color = self .bot .main_color
886+ )
887+ embed .add_field (name = 'Default:' , value = fmt (info ['default' ]), inline = False )
888+ embed .add_field (name = 'Information:' , value = fmt (info ['description' ]), inline = False )
889+ example_text = ''
890+ for example in info ['examples' ]:
891+ example_text += f'- { fmt (example )} \n '
892+ embed .add_field (name = 'Example(s):' , value = example_text , inline = False )
893+
894+ note_text = ''
895+ for note in info ['notes' ]:
896+ note_text += f'- { fmt (note )} \n '
897+ if note_text :
898+ embed .add_field (name = 'Notes(s):' , value = note_text , inline = False )
899+ return await ctx .send (embed = embed )
900+
852901 @commands .group (aliases = ["aliases" ], invoke_without_command = True )
853902 @checks .has_permissions (PermissionLevel .MODERATOR )
854903 async def alias (self , ctx , * , name : str .lower = None ):
0 commit comments