crxsnake 1.4.0__tar.gz → 1.4.2__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.
- {crxsnake-1.4.0 → crxsnake-1.4.2}/PKG-INFO +4 -4
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/__init__.py +12 -7
- crxsnake-1.4.2/crxsnake/cogs.py +18 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/files.py +0 -7
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/logger.py +1 -0
- crxsnake-1.4.2/crxsnake/tortoise.py +21 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/utils/misc.py +0 -6
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake.egg-info/PKG-INFO +4 -4
- crxsnake-1.4.2/crxsnake.egg-info/requires.txt +5 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/setup.py +4 -4
- crxsnake-1.4.0/crxsnake/cogs.py +0 -17
- crxsnake-1.4.0/crxsnake/tortoise.py +0 -20
- crxsnake-1.4.0/crxsnake.egg-info/requires.txt +0 -5
- {crxsnake-1.4.0 → crxsnake-1.4.2}/LICENSE +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/README.md +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/embed.py +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/utils/__init__.py +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/utils/convert.py +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/utils/crx.py +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake/utils/hotline.py +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake.egg-info/SOURCES.txt +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake.egg-info/dependency_links.txt +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/crxsnake.egg-info/top_level.txt +0 -0
- {crxsnake-1.4.0 → crxsnake-1.4.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: crxsnake
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.2
|
4
4
|
Home-page: https://discord.gg/EEp67FWQDP
|
5
5
|
Author: CRX-DEV
|
6
6
|
Author-email: cherniq66@gmail.com
|
@@ -9,9 +9,9 @@ Project-URL: Repository, https://github.com/cyrax-dev/crxsnake
|
|
9
9
|
Project-URL: Discord, https://discord.gg/EEp67FWQDP
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
|
-
Requires-Dist: setuptools==
|
13
|
-
Requires-Dist: tortoise-orm==0.
|
14
|
-
Requires-Dist: disnake==2.
|
12
|
+
Requires-Dist: setuptools==75.8.0
|
13
|
+
Requires-Dist: tortoise-orm==0.24.0
|
14
|
+
Requires-Dist: disnake==2.10.1
|
15
15
|
Requires-Dist: aiofiles==23.2.1
|
16
16
|
Requires-Dist: loguru==0.7.2
|
17
17
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from .logger import
|
1
|
+
from .logger import log
|
2
2
|
from .cogs import load_cogs
|
3
3
|
from .files import read_json, write_json
|
4
4
|
from .tortoise import Database
|
@@ -9,16 +9,21 @@ from .utils.hotline import IssueHotline
|
|
9
9
|
from .utils.crx import IssueCRX
|
10
10
|
from .utils.convert import steam_to_be_guid, steam_to_dayz_guid
|
11
11
|
|
12
|
-
|
13
12
|
__all__ = [
|
14
|
-
"logger",
|
15
|
-
"load_cogs",
|
16
|
-
"read_json",
|
17
|
-
"write_json",
|
18
13
|
"Database",
|
19
14
|
"IssueHotline",
|
20
15
|
"IssueCRX",
|
21
16
|
"EmbedMessage",
|
17
|
+
"load_cogs",
|
18
|
+
"read_json",
|
19
|
+
"write_json",
|
22
20
|
"steam_to_be_guid",
|
23
|
-
"steam_to_dayz_guid"
|
21
|
+
"steam_to_dayz_guid",
|
22
|
+
"log",
|
23
|
+
"trans",
|
24
|
+
"green",
|
25
|
+
"red",
|
26
|
+
"blue",
|
27
|
+
"yellow",
|
28
|
+
"purple"
|
24
29
|
]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
from sys import path
|
2
|
+
from pathlib import Path
|
3
|
+
from .logger import log
|
4
|
+
|
5
|
+
|
6
|
+
async def load_cogs(bot, folder: str = "src", utils_folder: str = "utils") -> None:
|
7
|
+
try:
|
8
|
+
path.append(str(Path(folder)))
|
9
|
+
|
10
|
+
for entry in Path(folder).iterdir():
|
11
|
+
for filename in entry.iterdir():
|
12
|
+
if filename.suffix == ".py" and entry.name != utils_folder:
|
13
|
+
bot.load_extension(f"{entry.name}.{filename.stem}")
|
14
|
+
|
15
|
+
log.info(f"[Discord] Cogs success loaded")
|
16
|
+
|
17
|
+
except Exception as e:
|
18
|
+
log.error(f"[Discord] An error occurred while loading modules\n╰─> Error: {e}")
|
@@ -1,13 +1,9 @@
|
|
1
1
|
from typing import Optional, Any
|
2
2
|
from json import loads, dumps
|
3
|
-
|
4
3
|
from aiofiles import open
|
5
4
|
|
6
5
|
|
7
6
|
async def read_json(path: str, *keys: str) -> Optional[Any]:
|
8
|
-
"""
|
9
|
-
Read data from json file.
|
10
|
-
"""
|
11
7
|
try:
|
12
8
|
async with open(path, "r", encoding="utf-8") as file:
|
13
9
|
file_content = await file.read()
|
@@ -25,9 +21,6 @@ async def read_json(path: str, *keys: str) -> Optional[Any]:
|
|
25
21
|
|
26
22
|
|
27
23
|
async def write_json(path: str, data: Any) -> bool:
|
28
|
-
"""
|
29
|
-
Write data to json file.
|
30
|
-
"""
|
31
24
|
try:
|
32
25
|
async with open(path, "w", encoding="utf-8") as file:
|
33
26
|
await file.write(dumps(data, ensure_ascii=False, indent=2))
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from .logger import log
|
2
|
+
from tortoise import Tortoise
|
3
|
+
|
4
|
+
|
5
|
+
class Database:
|
6
|
+
DB_URL = "sqlite://settings/database/database.db"
|
7
|
+
DB_MODEL = {"models": ["src.utils"]}
|
8
|
+
|
9
|
+
@staticmethod
|
10
|
+
async def db_connect() -> None:
|
11
|
+
try:
|
12
|
+
await Tortoise.init(db_url=Database.DB_URL, modules=Database.DB_MODEL)
|
13
|
+
await Tortoise.generate_schemas()
|
14
|
+
log.info("[Database] SqLite connected")
|
15
|
+
|
16
|
+
except Exception as e:
|
17
|
+
log.error(f"[Database] Failed to connect SqLite: {e}")
|
18
|
+
|
19
|
+
@staticmethod
|
20
|
+
async def disconnect_db() -> None:
|
21
|
+
await Tortoise.close_connections()
|
@@ -1,8 +1,6 @@
|
|
1
1
|
import re
|
2
2
|
import os
|
3
3
|
import sys
|
4
|
-
|
5
|
-
from datetime import datetime
|
6
4
|
from disnake import Embed
|
7
5
|
|
8
6
|
|
@@ -19,10 +17,6 @@ def restart():
|
|
19
17
|
os.execl(python, python, '-B', *sys.argv)
|
20
18
|
|
21
19
|
|
22
|
-
def get_unix_time() -> int:
|
23
|
-
return int(datetime.now().timestamp())
|
24
|
-
|
25
|
-
|
26
20
|
def get_user_id(field_index: int, embed: Embed) -> int:
|
27
21
|
user_id_str = re.search(r"<@!?(\d+)>", embed.fields[field_index].value).group(1)
|
28
22
|
return int(user_id_str)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: crxsnake
|
3
|
-
Version: 1.4.
|
3
|
+
Version: 1.4.2
|
4
4
|
Home-page: https://discord.gg/EEp67FWQDP
|
5
5
|
Author: CRX-DEV
|
6
6
|
Author-email: cherniq66@gmail.com
|
@@ -9,9 +9,9 @@ Project-URL: Repository, https://github.com/cyrax-dev/crxsnake
|
|
9
9
|
Project-URL: Discord, https://discord.gg/EEp67FWQDP
|
10
10
|
Description-Content-Type: text/markdown
|
11
11
|
License-File: LICENSE
|
12
|
-
Requires-Dist: setuptools==
|
13
|
-
Requires-Dist: tortoise-orm==0.
|
14
|
-
Requires-Dist: disnake==2.
|
12
|
+
Requires-Dist: setuptools==75.8.0
|
13
|
+
Requires-Dist: tortoise-orm==0.24.0
|
14
|
+
Requires-Dist: disnake==2.10.1
|
15
15
|
Requires-Dist: aiofiles==23.2.1
|
16
16
|
Requires-Dist: loguru==0.7.2
|
17
17
|
|
@@ -4,9 +4,9 @@ from pathlib import Path
|
|
4
4
|
this_directory = Path(__file__).parent
|
5
5
|
long_description = (this_directory / "README.md").read_text()
|
6
6
|
requires = [
|
7
|
-
"setuptools==
|
8
|
-
"tortoise-orm==0.
|
9
|
-
"disnake==2.
|
7
|
+
"setuptools==75.8.0",
|
8
|
+
"tortoise-orm==0.24.0",
|
9
|
+
"disnake==2.10.1",
|
10
10
|
"aiofiles==23.2.1",
|
11
11
|
"loguru==0.7.2",
|
12
12
|
]
|
@@ -17,7 +17,7 @@ urls = {
|
|
17
17
|
|
18
18
|
setup(
|
19
19
|
name="crxsnake",
|
20
|
-
version="1.4.
|
20
|
+
version="1.4.2",
|
21
21
|
long_description=long_description,
|
22
22
|
long_description_content_type="text/markdown",
|
23
23
|
author="CRX-DEV",
|
crxsnake-1.4.0/crxsnake/cogs.py
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
from loguru import logger
|
2
|
-
|
3
|
-
from sys import path
|
4
|
-
from pathlib import Path
|
5
|
-
|
6
|
-
|
7
|
-
async def load_cogs(bot) -> None:
|
8
|
-
directory_path = Path("src")
|
9
|
-
path.append(str(directory_path))
|
10
|
-
|
11
|
-
for entry in directory_path.iterdir():
|
12
|
-
for filename in entry.iterdir():
|
13
|
-
if filename.suffix == ".py" and entry.name != "utils":
|
14
|
-
try:
|
15
|
-
bot.load_extension(f"{entry.name}.{filename.stem}")
|
16
|
-
except Exception:
|
17
|
-
logger.exception(f"An error occurred while loading cog {entry.name}.{filename.stem}")
|
@@ -1,20 +0,0 @@
|
|
1
|
-
from loguru import logger
|
2
|
-
from tortoise import Tortoise
|
3
|
-
|
4
|
-
|
5
|
-
class Database:
|
6
|
-
DB_URL = "sqlite://settings/database/database.db"
|
7
|
-
DB_MODEL = {"models": ["src.utils"]}
|
8
|
-
|
9
|
-
async def db_connect(self) -> None:
|
10
|
-
"""
|
11
|
-
Connect to the database.
|
12
|
-
"""
|
13
|
-
try:
|
14
|
-
await Tortoise.init(db_url=self.DB_URL, modules=self.DB_MODEL)
|
15
|
-
await Tortoise.generate_schemas()
|
16
|
-
except Exception:
|
17
|
-
logger.exception("An error occurred while connecting to the database")
|
18
|
-
|
19
|
-
async def db_disconnect(self) -> None:
|
20
|
-
await Tortoise.close_connections()
|
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
|