diff --git a/controllers/api/faction/assist.py b/controllers/api/faction/assist.py index 4bb4aabd..85ee5286 100644 --- a/controllers/api/faction/assist.py +++ b/controllers/api/faction/assist.py @@ -247,14 +247,6 @@ def forward_assist(*args, **kwargs): }, ) - stat: StatModel = ( - StatModel.objects( - Q(tid=target_tid) & (Q(globalstat=True) | Q(addedfactiontid=user.factionid) | Q(addedid=user_tid)) - ) - .order_by("-timeadded") - .first() - ) - stat: typing.Optional[Stat] try: stat = Stat.get( diff --git a/controllers/api/stocks/movers.py b/controllers/api/stocks/movers.py index 8e42cd42..955e782c 100644 --- a/controllers/api/stocks/movers.py +++ b/controllers/api/stocks/movers.py @@ -28,7 +28,7 @@ def get_closest_tick(stock_id: int, start_timestamp: int): for n in range(1, 30): tick_id = int(bin(stock_id), 2) + int(bin((start_timestamp + n * 60) << 8), 2) - tick: typing.Optional[TickModel] = TickModel.objects(tick_id=tick_id).first() + tick: typing.Optional[StockTick] = StockTick.objects(tick_id=tick_id).first() if tick is not None: return tick diff --git a/skynet/commands/faction/fulfill.py b/skynet/commands/faction/fulfill.py index bd6445b7..0b2eba04 100644 --- a/skynet/commands/faction/fulfill.py +++ b/skynet/commands/faction/fulfill.py @@ -26,31 +26,6 @@ from skynet.skyutils import get_admin_keys -def fulfiller_string(withdrawal: WithdrawalModel) -> str: - if withdrawal.fulfiller == 0: - return "is not fulfilled" - elif withdrawal.fulfiller == -1: - return "has been cancelled by the system" - elif withdrawal.fulfiller < -1: - user: typing.Optional[UserModel] = UserModel.objects(tid=-withdrawal.fulfiller).only("name", "tid").first() - - if user is None: - return "has been cancelled by someone" - - return f"has been cancelled by {user.name} [{user.tid}]" - elif withdrawal.fulfiller == 1: - return "has been fulfilled by someone" - elif withdrawal.fulfiller > 1: - user: typing.Optional[UserModel] = UserModel.objects(tid=withdrawal.fulfiller).only("name", "tid").first() - - if user is None: - return "has been fulfilled by someone" - - return f"has been fulfilled by {user.name} [{user.tid}]" - - return "has an unknown fulfill type" - - def fulfill_command(interaction, *args, **kwargs): if "guild_id" not in interaction: return {