crxsnake 1.3.5__tar.gz → 1.3.7__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.3.5 → crxsnake-1.3.7}/PKG-INFO +1 -1
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/__init__.py +4 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/cogs.py +2 -2
- crxsnake-1.3.7/crxsnake/embed.py +26 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/files.py +2 -3
- crxsnake-1.3.7/crxsnake/utils/misc.py +28 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake.egg-info/PKG-INFO +1 -1
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake.egg-info/SOURCES.txt +1 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/setup.py +1 -1
- crxsnake-1.3.5/crxsnake/utils/misc.py +0 -24
- {crxsnake-1.3.5 → crxsnake-1.3.7}/LICENSE +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/README.md +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/logger.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/tortoise.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/utils/__init__.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/utils/convert.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/utils/crx.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake/utils/hotline.py +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake.egg-info/dependency_links.txt +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake.egg-info/requires.txt +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/crxsnake.egg-info/top_level.txt +0 -0
- {crxsnake-1.3.5 → crxsnake-1.3.7}/setup.cfg +0 -0
@@ -2,6 +2,7 @@ from .logger import logger
|
|
2
2
|
from .cogs import load_cogs
|
3
3
|
from .files import read_json, write_json
|
4
4
|
from .tortoise import Database
|
5
|
+
from .embed import EmbedMessage
|
5
6
|
|
6
7
|
from .utils.misc import *
|
7
8
|
from .utils.hotline import IssueHotline
|
@@ -17,4 +18,7 @@ __all__ = [
|
|
17
18
|
"Database",
|
18
19
|
"IssueHotline",
|
19
20
|
"IssueCRX",
|
21
|
+
"EmbedMessage",
|
22
|
+
"steam_to_be_guid",
|
23
|
+
"steam_to_dayz_guid"
|
20
24
|
]
|
@@ -4,8 +4,8 @@ from sys import path
|
|
4
4
|
from pathlib import Path
|
5
5
|
|
6
6
|
|
7
|
-
async def load_cogs(bot
|
8
|
-
directory_path = Path(
|
7
|
+
async def load_cogs(bot) -> None:
|
8
|
+
directory_path = Path("src")
|
9
9
|
path.append(str(directory_path))
|
10
10
|
|
11
11
|
for entry in directory_path.iterdir():
|
@@ -0,0 +1,26 @@
|
|
1
|
+
from disnake import Embed, Forbidden, Color
|
2
|
+
from disnake.ext import commands
|
3
|
+
|
4
|
+
|
5
|
+
class EmbedMessage:
|
6
|
+
|
7
|
+
def __init__(self, bot: commands.Bot):
|
8
|
+
self.bot = bot
|
9
|
+
|
10
|
+
async def send_channel(self, channel_id: int, title: str, desc: str, color: Color):
|
11
|
+
channel = await self.bot.fetch_channel(channel_id)
|
12
|
+
if channel:
|
13
|
+
embed = self.__create_embed(title, desc, color)
|
14
|
+
await channel.send(embed=embed)
|
15
|
+
|
16
|
+
async def send_user(self, user_id: int, title: str, desc: str, color: Color):
|
17
|
+
try:
|
18
|
+
user = await self.bot.fetch_user(user_id)
|
19
|
+
if user:
|
20
|
+
embed = self.__create_embed(title, desc, color)
|
21
|
+
await user.send(embed=embed)
|
22
|
+
except Forbidden:
|
23
|
+
pass
|
24
|
+
|
25
|
+
def __create_embed(self, title: str, desc: str, color: Color):
|
26
|
+
return Embed(title=title, description=desc, color=color)
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import re
|
2
|
+
import os
|
3
|
+
import sys
|
4
|
+
|
5
|
+
from datetime import datetime
|
6
|
+
from disnake import Embed
|
7
|
+
|
8
|
+
|
9
|
+
red = 16711680
|
10
|
+
green = 65280
|
11
|
+
blue = 255
|
12
|
+
yellow = 16776960
|
13
|
+
purple = 9109759
|
14
|
+
trans = 2829617
|
15
|
+
|
16
|
+
|
17
|
+
def restart():
|
18
|
+
python = sys.executable
|
19
|
+
os.execl(python, python, '-B', *sys.argv)
|
20
|
+
|
21
|
+
|
22
|
+
def get_unix_time() -> int:
|
23
|
+
return int(datetime.now().timestamp())
|
24
|
+
|
25
|
+
|
26
|
+
def get_user_id(field_index: int, embed: Embed) -> int:
|
27
|
+
user_id_str = re.search(r"<@!?(\d+)>", embed.fields[field_index].value).group(1)
|
28
|
+
return int(user_id_str)
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import os
|
2
|
-
import sys
|
3
|
-
|
4
|
-
from datetime import datetime
|
5
|
-
|
6
|
-
red = 16711680
|
7
|
-
green = 65280
|
8
|
-
blue = 255
|
9
|
-
yellow = 16776960
|
10
|
-
purple = 9109759
|
11
|
-
trans = 2829617
|
12
|
-
|
13
|
-
timestamp = int(datetime.now().timestamp())
|
14
|
-
time_short = f"<t:{timestamp}:d>"
|
15
|
-
time_long_date = f"<t:{timestamp}:D>"
|
16
|
-
time_short_time = f"<t:{timestamp}:t>"
|
17
|
-
time_long_time = f"<t:{timestamp}:T>"
|
18
|
-
time_full = f"<t:{timestamp}:f>"
|
19
|
-
time_relative = f"<t:{timestamp}:R>"
|
20
|
-
|
21
|
-
|
22
|
-
async def restart():
|
23
|
-
python = sys.executable
|
24
|
-
os.execl(python, python, '-B', *sys.argv)
|
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
|