mc5-api-client 1.0.12__py3-none-any.whl → 1.0.13__py3-none-any.whl
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.
- mc5_api_client/__init__.py +1 -1
- mc5_api_client/cli.py +1 -1
- mc5_api_client/client.py +38 -0
- mc5_api_client/simple_client.py +101 -0
- {mc5_api_client-1.0.12.dist-info → mc5_api_client-1.0.13.dist-info}/METADATA +1 -1
- mc5_api_client-1.0.13.dist-info/RECORD +15 -0
- mc5_api_client-1.0.12.dist-info/RECORD +0 -15
- {mc5_api_client-1.0.12.dist-info → mc5_api_client-1.0.13.dist-info}/WHEEL +0 -0
- {mc5_api_client-1.0.12.dist-info → mc5_api_client-1.0.13.dist-info}/entry_points.txt +0 -0
- {mc5_api_client-1.0.12.dist-info → mc5_api_client-1.0.13.dist-info}/licenses/LICENSE +0 -0
- {mc5_api_client-1.0.12.dist-info → mc5_api_client-1.0.13.dist-info}/top_level.txt +0 -0
mc5_api_client/__init__.py
CHANGED
mc5_api_client/cli.py
CHANGED
|
@@ -447,7 +447,7 @@ class MC5CLI:
|
|
|
447
447
|
|
|
448
448
|
def _print_version(self):
|
|
449
449
|
"""Print version information."""
|
|
450
|
-
self._print("MC5 API Client v1.0.
|
|
450
|
+
self._print("MC5 API Client v1.0.13", "cyan")
|
|
451
451
|
self._print("The ultimate Modern Combat 5 API library", "green")
|
|
452
452
|
self._print("Author: Chizoba", "blue")
|
|
453
453
|
self._print("Email: chizoba2026@hotmail.com", "blue")
|
mc5_api_client/client.py
CHANGED
|
@@ -522,6 +522,44 @@ class MC5Client:
|
|
|
522
522
|
url = f"{self.BASE_URLS['osiris']}/accounts/me/clan-applications/{clan_id}"
|
|
523
523
|
return self._make_request("DELETE", url)
|
|
524
524
|
|
|
525
|
+
def get_clan_requests(self, request_type: str = "membership_approval") -> List[Dict[str, Any]]:
|
|
526
|
+
"""
|
|
527
|
+
Get pending clan membership requests for the current user.
|
|
528
|
+
|
|
529
|
+
Args:
|
|
530
|
+
request_type: Type of requests to retrieve (default: "membership_approval")
|
|
531
|
+
|
|
532
|
+
Returns:
|
|
533
|
+
List of clan requests
|
|
534
|
+
"""
|
|
535
|
+
url = f"{self.BASE_URLS['osiris']}/accounts/me/requests"
|
|
536
|
+
params = {
|
|
537
|
+
"request_type": request_type
|
|
538
|
+
}
|
|
539
|
+
response = self._make_request("GET", url, params=params)
|
|
540
|
+
return response if isinstance(response, list) else []
|
|
541
|
+
|
|
542
|
+
def respond_to_clan_request(self, request_id: str, action: str, message: str = "") -> Dict[str, Any]:
|
|
543
|
+
"""
|
|
544
|
+
Respond to a clan membership request (accept/reject).
|
|
545
|
+
|
|
546
|
+
Args:
|
|
547
|
+
request_id: Request ID to respond to
|
|
548
|
+
action: Action to take ("accept" or "reject")
|
|
549
|
+
message: Optional message for the response
|
|
550
|
+
|
|
551
|
+
Returns:
|
|
552
|
+
Response result
|
|
553
|
+
"""
|
|
554
|
+
url = f"{self.BASE_URLS['osiris']}/accounts/me/requests/{request_id}"
|
|
555
|
+
data = {
|
|
556
|
+
"action": action
|
|
557
|
+
}
|
|
558
|
+
if message:
|
|
559
|
+
data["message"] = message
|
|
560
|
+
|
|
561
|
+
return self._make_request("POST", url, data=data)
|
|
562
|
+
|
|
525
563
|
def get_clan_statistics(self, clan_id: str) -> Dict[str, Any]:
|
|
526
564
|
"""
|
|
527
565
|
Get clan statistics and performance data.
|
mc5_api_client/simple_client.py
CHANGED
|
@@ -285,6 +285,107 @@ class SimpleMC5Client:
|
|
|
285
285
|
print(f"❌ Error sending message: {e}")
|
|
286
286
|
return False
|
|
287
287
|
|
|
288
|
+
def get_inbox_messages(self, limit: int = 20) -> List[Dict[str, Any]]:
|
|
289
|
+
"""
|
|
290
|
+
Get messages from your inbox.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
limit: Maximum number of messages to retrieve
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
List of inbox messages
|
|
297
|
+
"""
|
|
298
|
+
try:
|
|
299
|
+
messages = self.client.get_inbox_messages(limit=limit)
|
|
300
|
+
print(f"✅ Retrieved {len(messages)} messages from inbox")
|
|
301
|
+
return messages
|
|
302
|
+
except Exception as e:
|
|
303
|
+
print(f"❌ Error getting inbox messages: {e}")
|
|
304
|
+
return []
|
|
305
|
+
|
|
306
|
+
def delete_message(self, message_id: str) -> bool:
|
|
307
|
+
"""
|
|
308
|
+
Delete a single message from your inbox.
|
|
309
|
+
|
|
310
|
+
Args:
|
|
311
|
+
message_id: ID of the message to delete
|
|
312
|
+
|
|
313
|
+
Returns:
|
|
314
|
+
True if successful, False otherwise
|
|
315
|
+
"""
|
|
316
|
+
try:
|
|
317
|
+
result = self.client.delete_inbox_message(message_id)
|
|
318
|
+
if 'error' not in result:
|
|
319
|
+
print(f"✅ Message {message_id} deleted successfully")
|
|
320
|
+
return True
|
|
321
|
+
else:
|
|
322
|
+
print(f"❌ Failed to delete message: {result.get('error', 'Unknown error')}")
|
|
323
|
+
return False
|
|
324
|
+
except Exception as e:
|
|
325
|
+
print(f"❌ Error deleting message: {e}")
|
|
326
|
+
return False
|
|
327
|
+
|
|
328
|
+
def clear_inbox(self) -> bool:
|
|
329
|
+
"""
|
|
330
|
+
Clear all messages from your inbox.
|
|
331
|
+
|
|
332
|
+
Returns:
|
|
333
|
+
True if successful, False otherwise
|
|
334
|
+
"""
|
|
335
|
+
try:
|
|
336
|
+
result = self.client.clear_inbox()
|
|
337
|
+
if 'error' not in result:
|
|
338
|
+
print(f"✅ Inbox cleared successfully")
|
|
339
|
+
return True
|
|
340
|
+
else:
|
|
341
|
+
print(f"❌ Failed to clear inbox: {result.get('error', 'Unknown error')}")
|
|
342
|
+
return False
|
|
343
|
+
except Exception as e:
|
|
344
|
+
print(f"❌ Error clearing inbox: {e}")
|
|
345
|
+
return False
|
|
346
|
+
|
|
347
|
+
def get_clan_requests(self, request_type: str = "membership_approval") -> List[Dict[str, Any]]:
|
|
348
|
+
"""
|
|
349
|
+
Get pending clan membership requests.
|
|
350
|
+
|
|
351
|
+
Args:
|
|
352
|
+
request_type: Type of requests to retrieve
|
|
353
|
+
|
|
354
|
+
Returns:
|
|
355
|
+
List of clan requests
|
|
356
|
+
"""
|
|
357
|
+
try:
|
|
358
|
+
requests = self.client.get_clan_requests(request_type=request_type)
|
|
359
|
+
print(f"✅ Retrieved {len(requests)} clan requests")
|
|
360
|
+
return requests
|
|
361
|
+
except Exception as e:
|
|
362
|
+
print(f"❌ Error getting clan requests: {e}")
|
|
363
|
+
return []
|
|
364
|
+
|
|
365
|
+
def respond_to_clan_request(self, request_id: str, action: str, message: str = "") -> bool:
|
|
366
|
+
"""
|
|
367
|
+
Respond to a clan membership request.
|
|
368
|
+
|
|
369
|
+
Args:
|
|
370
|
+
request_id: ID of the request to respond to
|
|
371
|
+
action: Action to take ("accept" or "reject")
|
|
372
|
+
message: Optional message for the response
|
|
373
|
+
|
|
374
|
+
Returns:
|
|
375
|
+
True if successful, False otherwise
|
|
376
|
+
"""
|
|
377
|
+
try:
|
|
378
|
+
result = self.client.respond_to_clan_request(request_id, action, message)
|
|
379
|
+
if 'error' not in result:
|
|
380
|
+
print(f"✅ Clan request {action}ed successfully")
|
|
381
|
+
return True
|
|
382
|
+
else:
|
|
383
|
+
print(f"❌ Failed to {action} clan request: {result.get('error', 'Unknown error')}")
|
|
384
|
+
return False
|
|
385
|
+
except Exception as e:
|
|
386
|
+
print(f"❌ Error responding to clan request: {e}")
|
|
387
|
+
return False
|
|
388
|
+
|
|
288
389
|
def get_inactive_members(self, days_inactive: int = 30) -> List[Dict[str, Any]]:
|
|
289
390
|
"""
|
|
290
391
|
Get members who haven't been active for specified days.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
mc5_api_client/__init__.py,sha256=xuoqWZDVyIIK3xR-KZa62oO6ZmDfuo8jIE-I5ehtaM8,3296
|
|
2
|
+
mc5_api_client/admin_client.py,sha256=527aavolxVhY2M5ceFxVbbE5YTczU9Z86Fdt1UzdRZM,15220
|
|
3
|
+
mc5_api_client/auth.py,sha256=z8vmyQIHUdAzk0pUyKCesT8gTv4jboLIFGBxAu1v_-8,13396
|
|
4
|
+
mc5_api_client/cli.py,sha256=GObhHGpphRjcAEUPWn8X1FpR67EtQtqzHHSONLo2wKE,17255
|
|
5
|
+
mc5_api_client/client.py,sha256=1UYaX8UVl_edf-uRh-H_ja5BUWz1ytw52BdOKLuZq0I,80571
|
|
6
|
+
mc5_api_client/exceptions.py,sha256=o7od4GrEIlgq6xSNUjZdh74xoDTytF3PLcMq5ewRiJw,2683
|
|
7
|
+
mc5_api_client/help.py,sha256=sqf3R6VHQuSYLvAMzh8nXAgCX5URsvXydvw8P0ATabg,7246
|
|
8
|
+
mc5_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
mc5_api_client/simple_client.py,sha256=1sVytpSU-TMyDBOe1y_3Y6KjIc8tsZGWdI1eHIUmhmc,23747
|
|
10
|
+
mc5_api_client-1.0.13.dist-info/licenses/LICENSE,sha256=M0UBQ4B3pB9XcV54_jhVP681xyauF8GB6YK_rKmuXzk,1064
|
|
11
|
+
mc5_api_client-1.0.13.dist-info/METADATA,sha256=AnUR1t8uZ_KbSgPGbIZ2uq8o5_T9V-AD25KTQBz0104,55250
|
|
12
|
+
mc5_api_client-1.0.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
+
mc5_api_client-1.0.13.dist-info/entry_points.txt,sha256=2kruOpleFYK3Jl1MoQwGyqCd-Pj4kQWngXmIjnXx_gE,48
|
|
14
|
+
mc5_api_client-1.0.13.dist-info/top_level.txt,sha256=eYJe4ue9j1ig_jFY5Z05mDqpizUEV7TYpk5lBXVd4kA,15
|
|
15
|
+
mc5_api_client-1.0.13.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
mc5_api_client/__init__.py,sha256=Fez2LJHEpim5fUuHFiWa7IdM_nENxWAns6_pVL_k2m8,3296
|
|
2
|
-
mc5_api_client/admin_client.py,sha256=527aavolxVhY2M5ceFxVbbE5YTczU9Z86Fdt1UzdRZM,15220
|
|
3
|
-
mc5_api_client/auth.py,sha256=z8vmyQIHUdAzk0pUyKCesT8gTv4jboLIFGBxAu1v_-8,13396
|
|
4
|
-
mc5_api_client/cli.py,sha256=W7d_B8P_7qvvnAe-P3PQ-O6nW0ca7ADV3e9GLgEVylM,17255
|
|
5
|
-
mc5_api_client/client.py,sha256=q5PkdpTXjWCXdLFiK1-zqa7fThJGE4Z99A3ccMfwJIY,79239
|
|
6
|
-
mc5_api_client/exceptions.py,sha256=o7od4GrEIlgq6xSNUjZdh74xoDTytF3PLcMq5ewRiJw,2683
|
|
7
|
-
mc5_api_client/help.py,sha256=sqf3R6VHQuSYLvAMzh8nXAgCX5URsvXydvw8P0ATabg,7246
|
|
8
|
-
mc5_api_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
mc5_api_client/simple_client.py,sha256=31JI2rURHIXKcnDXQYJNpr-gypweO56ANFdhD-Z4Ft0,20241
|
|
10
|
-
mc5_api_client-1.0.12.dist-info/licenses/LICENSE,sha256=M0UBQ4B3pB9XcV54_jhVP681xyauF8GB6YK_rKmuXzk,1064
|
|
11
|
-
mc5_api_client-1.0.12.dist-info/METADATA,sha256=pG3KizNZF1p2VlhGUn9a0k1E0-TrpSrrgSMsjmJ22po,55250
|
|
12
|
-
mc5_api_client-1.0.12.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
13
|
-
mc5_api_client-1.0.12.dist-info/entry_points.txt,sha256=2kruOpleFYK3Jl1MoQwGyqCd-Pj4kQWngXmIjnXx_gE,48
|
|
14
|
-
mc5_api_client-1.0.12.dist-info/top_level.txt,sha256=eYJe4ue9j1ig_jFY5Z05mDqpizUEV7TYpk5lBXVd4kA,15
|
|
15
|
-
mc5_api_client-1.0.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|