Skip to content

Bot

bot ¤

intents module-attribute ¤

intents = default()

bot module-attribute ¤

bot = Bot(
    command_prefix=COMMAND_PREFIX,
    intents=intents,
    help_command=None,
)

on_ready async ¤

on_ready()

on_guild_join async ¤

on_guild_join(guild: Guild)

on_command_error async ¤

on_command_error(ctx: Context, error: CommandError)

start async ¤

start(db_done: Event)

base ¤

BaseCog ¤

BaseCog(bot: Bot)

Bases: Cog

bot instance-attribute ¤
bot = bot

channels ¤

channels module-attribute ¤

channels = _Channels()

_Channels ¤

debug class-attribute instance-attribute ¤
debug: TextChannel = None
price_alert class-attribute instance-attribute ¤
price_alert: TextChannel = None
init async ¤
init(bot: Bot)

converters ¤

AirportCvtr ¤

Bases: Converter

convert async ¤
convert(ctx: Context, query: str) -> SearchResult

AircraftCvtr ¤

Bases: Converter

convert async ¤
convert(ctx: Context, query: str) -> SearchResult

_ACROptions ¤

Bases: BaseModel

algorithm_pax instance-attribute ¤
algorithm_pax: PyConfigAlgorithmPax
algorithm_cargo instance-attribute ¤
algorithm_cargo: PyConfigAlgorithmCargo
max_distance instance-attribute ¤
max_distance: PyACROptionsMaxDistance
max_flight_time instance-attribute ¤
max_flight_time: timedelta
__tpd_mode instance-attribute ¤
__tpd_mode: PyACROptionsTPDMode
trips_per_day_per_ac instance-attribute ¤
trips_per_day_per_ac: PyACROptionsTripsPerDayPerAC

_SettingKeyCustom ¤

Bases: BaseModel

training instance-attribute ¤
training: Literal['max', 'min']

SettingValueCvtr ¤

Bases: Converter

convert async ¤
convert(ctx: Context, value: Any) -> Any

TPDCvtr ¤

Bases: Converter

_default class-attribute instance-attribute ¤
_default = (1, AUTO)
convert async ¤
convert(
    ctx: Context, tpdo: str
) -> tuple[int | None, TPDMode]

CfgAlgCvtr ¤

Bases: Converter

convert async ¤
convert(ctx: Context, alg: str) -> Algorithm | Algorithm
_default async staticmethod ¤
_default(ctx: Context) -> Algorithm | Algorithm

ConstraintCvtr ¤

Bases: Converter

_default class-attribute instance-attribute ¤
_default = (None, None)
to_flight_time ¤
to_flight_time(constraint: str) -> float | None
convert async ¤
convert(
    ctx: Context, constraint: str
) -> tuple[float | None, float | None]

_Price ¤

Bases: BaseModel

fuel instance-attribute ¤
fuel: float
co2 instance-attribute ¤
co2: float

PriceCvtr ¤

Bases: Converter

convert async ¤
convert(
    ctx: Context, price: str | None
) -> tuple[Literal["Fuel", "CO₂"], float] | None

acro_cast ¤

acro_cast(k: str, v: Any) -> _ACROptions

errors ¤

COLOUR_ERROR module-attribute ¤

COLOUR_ERROR = Colour(13268341)

Suggestions module-attribute ¤

Suggestions = list[tuple[str, str]]

AircraftNotFoundError ¤

AircraftNotFoundError(acsr: SearchResult)

Bases: BadArgument

acsr instance-attribute ¤
acsr = acsr

AirportNotFoundError ¤

AirportNotFoundError(apsr: SearchResult)

Bases: BadArgument

apsr instance-attribute ¤
apsr = apsr

ValidationErrorBase ¤

ValidationErrorBase(
    err: ValidationError | PydanticCustomError,
)

Bases: BadArgument

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

SettingValueValidationError ¤

SettingValueValidationError(
    err: ValidationError | PydanticCustomError,
)

Bases: ValidationErrorBase

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

TPDValidationError ¤

TPDValidationError(
    err: ValidationError | PydanticCustomError,
)

Bases: ValidationErrorBase

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

CfgAlgValidationError ¤

CfgAlgValidationError(
    err: ValidationError | PydanticCustomError,
)

Bases: ValidationErrorBase

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

ConstraintValidationError ¤

ConstraintValidationError(
    err: ValidationError | PydanticCustomError,
)

Bases: ValidationErrorBase

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

PriceValidationError ¤

PriceValidationError(
    err: ValidationError | PydanticCustomError,
)

Bases: ValidationErrorBase

err instance-attribute ¤
err = err
msg instance-attribute ¤
msg = join(
    f"`{join(e['loc'])}`: {e['msg']}" for e in errors()
)

UserBannedError ¤

Bases: BadArgument

OutsideMainServerError ¤

Bases: CheckFailure

CustomErrHandler ¤

CustomErrHandler(
    ctx: Context,
    error: CommandError = commands.CommandError(),
    cmd: str | None = None,
)
ctx instance-attribute ¤
ctx = ctx
error instance-attribute ¤
error = error
cmd instance-attribute ¤
cmd = cmd
handled instance-attribute ¤
handled = False
err_tb property ¤
err_tb: str
raise_for_unhandled async ¤
raise_for_unhandled()
_get_err_embed ¤
_get_err_embed(
    title: str,
    description: str | None,
    suggs: Suggestions | None = None,
    sugg_cmd_override: list[str] = [],
) -> Embed
invalid_aircraft async ¤
invalid_aircraft()
invalid_airport async ¤
invalid_airport(*, route_typo: bool = False)
invalid_setting_value async ¤
invalid_setting_value()
invalid_tpd async ¤
invalid_tpd()
invalid_cfg_alg async ¤
invalid_cfg_alg()
invalid_constraint async ¤
invalid_constraint()
invalid_price async ¤
invalid_price()
banned_user async ¤
banned_user()
too_many_args async ¤
too_many_args(arg_name: str)
bad_literal async ¤
bad_literal(
    get_cmd_suggs: Callable[[list[str]], list[str]]
)
_missing_arg async ¤
_missing_arg()
_expected_closing_quote_error async ¤
_expected_closing_quote_error()
_invalid_end_of_quoted_string_error async ¤
_invalid_end_of_quoted_string_error()
_unexpected_quote_error async ¤
_unexpected_quote_error()
_main_server_only async ¤
_main_server_only()
_no_pm async ¤
_no_pm()
_command_not_found async ¤
_command_not_found()
common_mistakes async ¤
common_mistakes()
top_level async ¤
top_level()

plots ¤

_executor module-attribute ¤

_executor = ProcessPoolExecutor(max_workers=1)

mpl_map module-attribute ¤

mpl_map = MPLMap()

MPLMap ¤

MPLMap()
transformer instance-attribute ¤
transformer = from_crs(
    4326,
    from_string("+proj=peirce_q +lon_0=25 +shape=square"),
)
cmap instance-attribute ¤
cmap = crop_by_percent(dense_r, 30, which='min')
cmap2 instance-attribute ¤
cmap2 = crop_by_percent(curl, 50)
init_template ¤
init_template()
_plot_destinations ¤
_plot_destinations(
    cols: dict[str, list],
    origin_lng: float,
    origin_lat: float,
) -> BytesIO
plot_destinations async ¤
plot_destinations(
    cols: dict[str, list],
    origin_lng: float,
    origin_lat: float,
) -> BytesIO

utils ¤

GUIDE_DEV_ROLEID module-attribute ¤

GUIDE_DEV_ROLEID = 646148607636144131

STAR_ROLEID module-attribute ¤

STAR_ROLEID = 701410528853098497

COLOUR_GENERIC module-attribute ¤

COLOUR_GENERIC = Colour(10464445)

COLOUR_ERROR module-attribute ¤

COLOUR_ERROR = Colour(13268341)

COLOUR_WARNING module-attribute ¤

COLOUR_WARNING = Colour(16755023)

COLOUR_SUCCESS module-attribute ¤

COLOUR_SUCCESS = Colour(7719555)

COLOUR_REALISM module-attribute ¤

COLOUR_REALISM = Colour(2588365)

COLOUR_EASY module-attribute ¤

COLOUR_EASY = Colour(1734969)

IY module-attribute ¤

IY = '<:economy:701335275896307742>'

IJ module-attribute ¤

IJ = '<:business:701335275669946431>'

IF module-attribute ¤

IF = '<:first:701335275938381824>'

IL module-attribute ¤

IL = '<:large:701335275690786817>'

IH module-attribute ¤

IH = '<:heavy:701335275799969833>'

ICSV module-attribute ¤

ICSV = '<:csv:1210823880172904448>'

IJSON module-attribute ¤

IJSON = '<:json:1210823838334586880>'

HELP_TPD module-attribute ¤

HELP_TPD = "**Number of departures per day, per aircraft**\n- if not provided or set to `AUTO`, the bot will attempt to maximise it.\n- if you provide a number, the bot will try to assign more aircraft to the same route to avoid wasting demand.\n  - to disable the cramming, append a `!` at the end (not recommended)."

HELP_CFG_ALG module-attribute ¤

HELP_CFG_ALG = f'**Configuration Algorithm**
- {join(f''`'{c}'`'' for c in __members__)} (pax)
- {join(f''`'{c}'`'' for c in __members__)} (cargo)
The best algorithm is picked automatically depending on the route distance.
`YJF` here denotes the order of priority when filling seats.'

HELP_SETTING_KEY module-attribute ¤

HELP_SETTING_KEY = f'**The setting key** - some important ones are:
- `fourx`: {HELP_U_FOURX}
- `income_loss_tol`: {HELP_U_INCOME_LOSS_TOL}
- `load`: {HELP_U_LOAD}
'

_SP100 module-attribute ¤

_SP100 = '\u2003'

_SP050 module-attribute ¤

_SP050 = '\u2002'

_SP033 module-attribute ¤

_SP033 = '\u2004'

_SP025 module-attribute ¤

_SP025 = '\u2005'

_SP022 module-attribute ¤

_SP022 = '\u205f'

_SP016 module-attribute ¤

_SP016 = '\u2006'

_SPHAIR module-attribute ¤

_SPHAIR = '\u200a'

_SPPUNC module-attribute ¤

_SPPUNC = '\u2008'

fetch_user_info async ¤

fetch_user_info(ctx: Context) -> tuple[User, UserExtra]

get_user_colour ¤

get_user_colour(user: User) -> Colour

format_flight_time ¤

format_flight_time(t: float, short: bool = False) -> str

format_ap_short ¤

format_ap_short(ap: Airport, mode: Literal[0, 1, 2]) -> str

format_demand ¤

format_demand(
    pax_demand: PaxDemand, as_cargo: bool = False
) -> str

format_config ¤

format_config(cfg: PaxConfig | CargoConfig) -> str

format_ticket ¤

format_ticket(
    ticket: PaxTicket | CargoTicket | VIPTicket,
) -> str

format_modifiers ¤

format_modifiers(apr: Aircraft)

format_warning ¤

format_warning(w: Warning)

format_num ¤

format_num(num: float, *_pos) -> str

main_server_only ¤

main_server_only()