CraftiGames.py 2.2.8__tar.gz → 2.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/JartexnetworkWrapper.py +5 -2
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/PikanetworkWrapper.py +5 -2
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Punishments/__init__.py +27 -6
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames.py.egg-info/PKG-INFO +1 -1
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/PKG-INFO +1 -1
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/setup.py +1 -1
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Games/Bedwars.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Games/Practice.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Games/Skywars.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Games/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Ratelimits/JartexNetworkRateLimitHandler.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Ratelimits/PikaNetworkRateLimitHandler.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Ratelimits/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/Guilds.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/Leaderboard.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/NetworkStatus.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/Profiles.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/Recaps.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/RefactorAPI/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/ResponseError/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Skins/StarlightWrapper.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Skins/SurgeplayWrapper.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Skins/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/_Logger/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/__init__.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/utils.py +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames.py.egg-info/SOURCES.txt +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames.py.egg-info/dependency_links.txt +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames.py.egg-info/requires.txt +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames.py.egg-info/top_level.txt +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/LICENSE +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/MANIFEST.in +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/README.md +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/requirements.txt +0 -0
- {craftigames_py-2.2.8 → craftigames_py-2.2.9}/setup.cfg +0 -0
|
@@ -593,7 +593,7 @@ class Jartexnetwork:
|
|
|
593
593
|
async def Punishment(
|
|
594
594
|
self,
|
|
595
595
|
player: str,
|
|
596
|
-
type: Literal["
|
|
596
|
+
type: Literal["bans", "mutes", "warnings", "kicks", "all"] = "all",
|
|
597
597
|
list_console: bool = False,
|
|
598
598
|
**kwargs
|
|
599
599
|
) -> Union[dict, None]:
|
|
@@ -619,7 +619,10 @@ class Jartexnetwork:
|
|
|
619
619
|
async with self.session.get(f'https://jartexnetwork.com/bans/search/{player}/?filter={type}', proxy=proxy) as resp:
|
|
620
620
|
status = resp.status
|
|
621
621
|
if status == 200:
|
|
622
|
-
return History(await resp.text()).all(
|
|
622
|
+
return History(await resp.text()).all(
|
|
623
|
+
list_console=list_console,
|
|
624
|
+
punishment_type=type,
|
|
625
|
+
)
|
|
623
626
|
elif status == 429 and Recursion <= allowed_recursion:
|
|
624
627
|
Recursion += 1
|
|
625
628
|
packages.asyncio.create_task(log('Exceeded ratelimit: ', Recursion, 'X'))
|
|
@@ -645,7 +645,7 @@ class Pikanetwork:
|
|
|
645
645
|
async def Punishment(
|
|
646
646
|
self,
|
|
647
647
|
player: str,
|
|
648
|
-
type: Literal["
|
|
648
|
+
type: Literal["bans", "mutes", "warnings", "kicks", "all"] = "all",
|
|
649
649
|
list_console: bool = False,
|
|
650
650
|
**kwargs: Missing
|
|
651
651
|
) -> Union[dict, None]:
|
|
@@ -675,7 +675,10 @@ class Pikanetwork:
|
|
|
675
675
|
status = resp.status
|
|
676
676
|
|
|
677
677
|
if status == 200:
|
|
678
|
-
return History(await resp.text()).all(
|
|
678
|
+
return History(await resp.text()).all(
|
|
679
|
+
list_console=list_console,
|
|
680
|
+
punishment_type=type,
|
|
681
|
+
)
|
|
679
682
|
|
|
680
683
|
elif status == 429 and Recursion <= config.allowed_recursion:
|
|
681
684
|
|
|
@@ -60,21 +60,42 @@ class History:
|
|
|
60
60
|
|
|
61
61
|
def all(
|
|
62
62
|
self,
|
|
63
|
-
list_console: bool = True
|
|
63
|
+
list_console: bool = True,
|
|
64
|
+
punishment_type: str = "all"
|
|
64
65
|
) -> dict:
|
|
65
66
|
|
|
66
67
|
soup = packages.BeautifulSoup(self.__html_parser__, 'html.parser')
|
|
67
68
|
player = soup.title.string[:-28] if soup.title is not None else "Not found"
|
|
68
69
|
punishments: dict = {}
|
|
69
70
|
prow = []
|
|
71
|
+
type_by_filter = {
|
|
72
|
+
"bans": "ban",
|
|
73
|
+
"kicks": "kick",
|
|
74
|
+
"mutes": "mute",
|
|
75
|
+
"warnings": "warning",
|
|
76
|
+
}
|
|
70
77
|
for row in soup.find_all(class_='row'):
|
|
71
78
|
row: packages.BeautifulSoup
|
|
72
79
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
80
|
+
reason_element = row.find(class_='_reason')
|
|
81
|
+
date_element = row.find(class_='_date')
|
|
82
|
+
staff_element = row.find(class_='user-link')
|
|
83
|
+
if reason_element is None or date_element is None or staff_element is None:
|
|
84
|
+
raise ValueError("Punishment row is missing its reason, date, or staff member.")
|
|
85
|
+
|
|
86
|
+
reason = reason_element.get_text(strip=True)
|
|
87
|
+
date = date_element.get_text(strip=True)
|
|
88
|
+
expires_element = row.find(class_='_expires')
|
|
89
|
+
expires = expires_element.get_text(strip=True) if expires_element else "N/A"
|
|
90
|
+
type_element = row.find(class_='_type')
|
|
91
|
+
ptype = (
|
|
92
|
+
type_element.get_text(strip=True)
|
|
93
|
+
if type_element is not None
|
|
94
|
+
else type_by_filter.get(punishment_type, "")
|
|
95
|
+
)
|
|
96
|
+
if not ptype:
|
|
97
|
+
raise ValueError("Punishment row is missing its type.")
|
|
98
|
+
by = staff_element.get_text(strip=True)
|
|
78
99
|
|
|
79
100
|
if list_console is False and by.lower() == 'console':
|
|
80
101
|
continue
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{craftigames_py-2.2.8 → craftigames_py-2.2.9}/CraftiGames/Ratelimits/PikaNetworkRateLimitHandler.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|