mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[Docs] Add bank docs (#900)
* Add bank docs * [Docs] fix bank docstrings for formatting * [Docs] add bank to toctree * rename and make bank rst use members * Formatting changes * Add account to dunder all
This commit is contained in:
42
docs/framework_bank.rst
Normal file
42
docs/framework_bank.rst
Normal file
@@ -0,0 +1,42 @@
|
||||
.. V3 Bank
|
||||
|
||||
.. role:: python(code)
|
||||
:language: python
|
||||
|
||||
====
|
||||
Bank
|
||||
====
|
||||
|
||||
Bank has now been separated from Economy for V3. New to bank is support for
|
||||
having a global bank.
|
||||
|
||||
***********
|
||||
Basic Usage
|
||||
***********
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from core import bank
|
||||
|
||||
class MyCog:
|
||||
@commands.command()
|
||||
async def balance(self, ctx, user: discord.Member=None):
|
||||
if user is None:
|
||||
user = ctx.author
|
||||
bal = bank.get_balance(user)
|
||||
currency = bank.get_currency_name(ctx.guild)
|
||||
await ctx.send(
|
||||
"{}'s balance is {} {}".format(
|
||||
user.display_name, bal, currency
|
||||
)
|
||||
)
|
||||
|
||||
*************
|
||||
API Reference
|
||||
*************
|
||||
|
||||
Bank
|
||||
======
|
||||
|
||||
.. automodule:: core.bank
|
||||
:members:
|
||||
Reference in New Issue
Block a user