@@ -155,6 +155,22 @@ Here is an example of the :code:`async with` syntax:
155155 blah.append(new_blah)
156156 await ctx.send(" The new blah value has been added!" )
157157
158+ There is also a :py:meth: `Group.all ` method. This will return all the stored data associated
159+ with a specific config group as a :py:class: `dict `. By negating the need to excessively call config,
160+ this method can be particularly useful when multiple values are to be retrieved from the same group.
161+
162+ Here is an example of :py:meth: `Group.all ` usage:
163+
164+ .. code-block :: python
165+
166+ @commands.command ()
167+ async def getall (self , ctx ):
168+ all_global_data = await self .config.all()
169+ await ctx.send(" Foobar is {foobar} , foo baz is {foo_baz} " .format(
170+ foobar = str (all_global_data[" foobar" ]),
171+ foo_baz = str (all_global_data[" foo" ][" baz" ])
172+ ))
173+
158174
159175 .. important ::
160176
@@ -398,7 +414,7 @@ We're responsible pet owners here, so we've also got to have a way to feed our p
398414 # We could accomplish the same thing a slightly different way
399415 await self.config.user(ctx.author).pets.get_attr(pet_name).hunger.set(new_hunger)
400416
401- await ctx.send("Your pet is now at {}/100 hunger!".format(new_hunger)
417+ await ctx.send("Your pet is now at {}/100 hunger!".format(new_hunger))
402418
403419Of course, if we're less than responsible pet owners, there are consequences::
404420
@@ -481,7 +497,7 @@ Config prioritizes being a safe data store without developers needing to
481497know how end users have configured their bot.
482498
483499This does come with some performance costs, so keep the following in mind when choosing to
484- develop using config
500+ develop using config.
485501
486502* Config use in events should be kept minimal and should only occur
487503 after confirming the event needs to interact with config
0 commit comments