Models
bd_models.models
Ball
Bases: Model
capacity_description
capacity_description = CharField(max_length=256, help_text="Description of the countryball's capacity")
capacity_logic
capacity_name
capacity_name = CharField(max_length=64, help_text="Name of the countryball's capacity")
catch_names
catch_names = TextField(blank=True, null=True, help_text='Additional possible names for catching this ball, separated by semicolons')
collection_card
collection_card = ImageField(max_length=200, help_text='Image used when displaying balls')
economy
economy = ForeignKey(Economy, on_delete=SET_NULL, blank=True, null=True, help_text='Economical regime of this country')
short_name
short_name = CharField(max_length=24, blank=True, null=True, help_text='An alternative shorter name used only when generating the card, if the base name is too long.')
tradeable
tradeable = BooleanField(help_text='Whether this ball can be traded with others', default=True)
wild_card
wild_card = ImageField(max_length=200, help_text='Image used when a new ball spawns in the wild')
Meta
__str__
__str__() -> str
collection_image
save
save(force_insert: bool = False, force_update: bool = False, using: str | None = None, update_fields: Iterable[str] | None = None) -> None
Source code in admin_panel/bd_models/models.py
BallInstance
Bases: Model
locked
locked = DateTimeField(null=True, help_text='If the instance was locked for a trade and when', default=None)
server_id
server_id = BigIntegerField(null=True, help_text='Discord server ID where this ball was caught')
trade_player
trade_player = ForeignKey(Player, on_delete=SET_NULL, related_name='ballinstance_trade_player_set', null=True)
Meta
__getattribute__
Source code in admin_panel/bd_models/models.py
__str__
__str__() -> str
admin_description
Source code in admin_panel/bd_models/models.py
catch_time
description
description(*, short: bool = False, include_emoji: bool = False, bot: 'BallsDexBot | None' = None, is_trade: bool = False) -> str
Source code in admin_panel/bd_models/models.py
draw_card
draw_card() -> BytesIO
is_locked
lock_for_trade
prepare_for_message
prepare_for_message(interaction: Interaction['BallsDexBot']) -> tuple[str, File, View]
Source code in admin_panel/bd_models/models.py
short_description
Return a short string representation. Similar to str(x) without arguments.
Source code in admin_panel/bd_models/models.py
BlacklistHistory
Bases: Model
BlacklistedGuild
Bases: Model
BlacklistedID
Bases: Model
Block
Bases: Model
Economy
Bases: Model
Meta
EnabledManager
Friendship
Bases: Model
GuildConfig
Bases: Model
enabled
enabled = BooleanField(help_text='Whether the bot will spawn countryballs in this guild', default=True)
silent
silent = BooleanField(help_text='Whether the responses of guesses get sent as ephemeral or not', default=False)
spawn_channel
spawn_channel = BigIntegerField(null=True, help_text='Discord channel ID where balls will spawn')
Manager
Bases: from_queryset(QuerySet)
Player
Bases: Model
donation_policy
donation_policy = SmallIntegerField(choices=choices, help_text='How you want to handle donations', default=ALWAYS_ACCEPT)
friend_policy
friend_policy = SmallIntegerField(choices=choices, help_text='Open or close your friend requests', default=ALLOW)
mention_policy
mention_policy = SmallIntegerField(choices=choices, help_text="Control the bot's mentions", default=ALLOW)
privacy_policy
privacy_policy = SmallIntegerField(choices=choices, help_text='How you want to handle inventory privacy', default=DENY)
trade_cooldown_policy
trade_cooldown_policy = SmallIntegerField(choices=choices, help_text='To bypass or not the trade cooldown')
__str__
__str__() -> str
add_money
can_afford
is_blocked
is_blocked(other_player: 'Player') -> bool
is_friend
is_friend(other_player: 'Player') -> bool
QuerySet
Bases: QuerySet[T]
aall
aall() -> list[T]
aget_or_none
Regime
Bases: Model
Special
Bases: Model
background
background = ImageField(max_length=200, blank=True, null=True, help_text='1428x2000 PNG image')
catch_phrase
catch_phrase = CharField(max_length=128, blank=True, null=True, help_text='Sentence sent in bonus when someone catches a special card')
credits
credits = CharField(max_length=64, help_text='Author of the special event artwork', null=True)
emoji
emoji = CharField(max_length=20, blank=True, null=True, help_text='Either a unicode character or a discord emoji ID')
end_date
end_date = DateTimeField(blank=True, null=True, help_text='End time of the event. If blank, the event is permanent')
rarity
rarity = FloatField(help_text='Value between 0 and 1, chances of using this special background.')
start_date
start_date = DateTimeField(blank=True, null=True, help_text='Start time of the event. If blank, starts immediately')
tradeable
tradeable = BooleanField(help_text='Whether balls of this event can be traded', default=True)
SpecialEnabledManager
Trade
Bases: Model
Meta
TradeObject
Bases: Model
TradeableManager
image_display
image_display(image_link: str) -> SafeText