mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-29 02:57:22 +00:00
⏪ Revert "🐛 Fix gcsim filter by alternative names"
This reverts commit 19fb808cf2
.
This commit is contained in:
parent
8ca7845f5e
commit
768229ecdc
@ -13,7 +13,7 @@ from core.plugin import Plugin, handler
|
|||||||
from core.services.players import PlayersService
|
from core.services.players import PlayersService
|
||||||
from gram_core.services.template.services import TemplateService
|
from gram_core.services.template.services import TemplateService
|
||||||
from gram_core.services.users.services import UserAdminService
|
from gram_core.services.users.services import UserAdminService
|
||||||
from metadata.shortname import roles, roleToName, roleToId
|
from metadata.shortname import roleToName, roleToId
|
||||||
from modules.gcsim.file import PlayerGCSimScripts
|
from modules.gcsim.file import PlayerGCSimScripts
|
||||||
from modules.playercards.file import PlayerCardsFile
|
from modules.playercards.file import PlayerCardsFile
|
||||||
from plugins.genshin.gcsim.renderer import GCSimResultRenderer
|
from plugins.genshin.gcsim.renderer import GCSimResultRenderer
|
||||||
@ -113,14 +113,7 @@ class GCSimPlugin(Plugin):
|
|||||||
def _filter_fits_by_names(names: List[str], fits: List[GCSimFit]) -> List[GCSimFit]:
|
def _filter_fits_by_names(names: List[str], fits: List[GCSimFit]) -> List[GCSimFit]:
|
||||||
if not names:
|
if not names:
|
||||||
return fits
|
return fits
|
||||||
return [
|
return [fit for fit in fits if all(name in [str(i) for i in fit.characters] for name in names)]
|
||||||
fit
|
|
||||||
for fit in fits
|
|
||||||
if all(
|
|
||||||
name in [alternative_names for gc in fit.characters for alternative_names in roles[gc.id]]
|
|
||||||
for name in names
|
|
||||||
)
|
|
||||||
]
|
|
||||||
|
|
||||||
async def _get_uid_names(
|
async def _get_uid_names(
|
||||||
self, user_id: int, args: List[str], reply: Optional["Message"]
|
self, user_id: int, args: List[str], reply: Optional["Message"]
|
||||||
|
Loading…
Reference in New Issue
Block a user