GoldyBot.objects.currency
1class Currency(): 2 """ 3 Base class for a currency in Goldy Bot. Use this to create you own custom currency. 4 5 --------------- 6 ### ***``Example:``*** 7 8 Hello, want to make your own custom currency? Well anyways you came to the right place. 9 Below I show you an example on how to create your very own currency in Goldy Bot using the currency base class. 10 11 ```python 12 class GBP(GoldyBot.Currency): 13 def __init__(self): 14 super().__init__("GBP", "British Pounds", "💷", 600) 15 ``` 16 - This is how a custom currency is implemented. The code name is ``GBP``, the display name is ``British Pounds``, the currency icon/emoji is a ``pound banknote`` (💷) emoji and the default balance for this currency is 600. 17 18 ```python 19 class UwUCoin(GoldyBot.Currency): 20 def __init__(self): 21 super().__init__("uwu_coin", "UwU Coin", "🟡", 0) 22 ``` 23 - Here's another example for fun. 😁 24 """ 25 26 def __init__(self, code_name:str, display_name:str, display_emoji:str="💷", default_bal:int=600): 27 self.code_name_ = code_name 28 self.display_name_ = display_name 29 self.display_emoji_ = display_emoji 30 self.default_bal_ = default_bal 31 32 @property 33 def code_name(self): 34 """Returns code name of currency.""" 35 return self.code_name_ 36 37 @property 38 def display_name(self): 39 """Returns display name of currency.""" 40 return self.display_name_ 41 42 @property 43 def display_emoji(self): 44 """Returns some sort of emoji or icon that is used to identify this currency.""" 45 return self.display_emoji_ 46 47 @property 48 def default_bal(self): 49 """Returns the default balance for this currency.""" 50 return self.default_bal_ 51 52class GoldyCredits(Currency): 53 """The main Goldy Bot currency.""" 54 def __init__(self): 55 super().__init__("goldCoins", "Goldy Credits")
class
Currency:
2class Currency(): 3 """ 4 Base class for a currency in Goldy Bot. Use this to create you own custom currency. 5 6 --------------- 7 ### ***``Example:``*** 8 9 Hello, want to make your own custom currency? Well anyways you came to the right place. 10 Below I show you an example on how to create your very own currency in Goldy Bot using the currency base class. 11 12 ```python 13 class GBP(GoldyBot.Currency): 14 def __init__(self): 15 super().__init__("GBP", "British Pounds", "💷", 600) 16 ``` 17 - This is how a custom currency is implemented. The code name is ``GBP``, the display name is ``British Pounds``, the currency icon/emoji is a ``pound banknote`` (💷) emoji and the default balance for this currency is 600. 18 19 ```python 20 class UwUCoin(GoldyBot.Currency): 21 def __init__(self): 22 super().__init__("uwu_coin", "UwU Coin", "🟡", 0) 23 ``` 24 - Here's another example for fun. 😁 25 """ 26 27 def __init__(self, code_name:str, display_name:str, display_emoji:str="💷", default_bal:int=600): 28 self.code_name_ = code_name 29 self.display_name_ = display_name 30 self.display_emoji_ = display_emoji 31 self.default_bal_ = default_bal 32 33 @property 34 def code_name(self): 35 """Returns code name of currency.""" 36 return self.code_name_ 37 38 @property 39 def display_name(self): 40 """Returns display name of currency.""" 41 return self.display_name_ 42 43 @property 44 def display_emoji(self): 45 """Returns some sort of emoji or icon that is used to identify this currency.""" 46 return self.display_emoji_ 47 48 @property 49 def default_bal(self): 50 """Returns the default balance for this currency.""" 51 return self.default_bal_
Base class for a currency in Goldy Bot. Use this to create you own custom currency.
Example:
Hello, want to make your own custom currency? Well anyways you came to the right place. Below I show you an example on how to create your very own currency in Goldy Bot using the currency base class.
class GBP(GoldyBot.Currency):
def __init__(self):
super().__init__("GBP", "British Pounds", "💷", 600)
- This is how a custom currency is implemented. The code name is
GBP
, the display name isBritish Pounds
, the currency icon/emoji is apound banknote
(💷) emoji and the default balance for this currency is 600.
class UwUCoin(GoldyBot.Currency):
def __init__(self):
super().__init__("uwu_coin", "UwU Coin", "🟡", 0)
- Here's another example for fun. 😁
53class GoldyCredits(Currency): 54 """The main Goldy Bot currency.""" 55 def __init__(self): 56 super().__init__("goldCoins", "Goldy Credits")
The main Goldy Bot currency.