dshellInterpreter 1.2.7.4__tar.gz → 1.2.7.6__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.
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_file.py +1 -4
- dshellinterpreter-1.2.7.6/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +31 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/ast_nodes.py +24 -33
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/dshell_preprocess.py +5 -1
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_tokenizer.py +1 -1
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/full_import.py +0 -1
- {dshellinterpreter-1.2.7.4/dshellInterpreter.egg-info → dshellinterpreter-1.2.7.6}/PKG-INFO +2 -2
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6/dshellInterpreter.egg-info}/PKG-INFO +2 -2
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/setup.py +2 -2
- dshellinterpreter-1.2.7.4/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -28
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_embed.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_interaction.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_ui.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_file.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_global.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_list.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_member.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_numbers.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_string.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_type_validation.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/cached_messages.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_arguments.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_global_variables.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_interpreter.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_iterators.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_scope.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/errors.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/utils_interpreter.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/dshell_parser.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/errors.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/__init__.py +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/LICENSE +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/README.md +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/setup.cfg +0 -0
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_file.py
RENAMED
|
@@ -27,9 +27,6 @@ async def dshell_get_message_files(ctx: Message, message: Union[StrNode, IntNode
|
|
|
27
27
|
|
|
28
28
|
attachments_list: ListNode = ListNode([], bypass_limit_elt=True)
|
|
29
29
|
|
|
30
|
-
if isinstance(target_message, PartialMessage):
|
|
31
|
-
target_message = await target_message.fetch()
|
|
32
|
-
|
|
33
30
|
for attachment in target_message.attachments:
|
|
34
31
|
if attachment.content_type is not None and attachment.content_type.startswith("text/"):
|
|
35
32
|
file = FileNode(name=attachment.filename,
|
|
@@ -91,7 +88,7 @@ async def dshell_write_file(ctx: Message,
|
|
|
91
88
|
_validate_required_bool(append, 'append', 'wf')
|
|
92
89
|
_validate_optional_string(filename, 'filename', 'wf')
|
|
93
90
|
|
|
94
|
-
target_file = file if isinstance(file, FileNode) else FileNode(filename if filename is not None else "unnamed_file.txt")
|
|
91
|
+
target_file = file if isinstance(file, FileNode) else FileNode(filename if filename is not None else StrNode("unnamed_file.txt"))
|
|
95
92
|
|
|
96
93
|
target_file.description = description if description is not None else target_file.description
|
|
97
94
|
target_file.spoiler = spoiler if spoiler is not None else target_file.spoiler
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
from requests import get
|
|
2
|
+
from Dshell.full_import import Message
|
|
3
|
+
from .utils.utils_type_validation import _validate_required_string
|
|
4
|
+
from ..DshellParser.ast_nodes import StrNode, BoolNode, ListNode, FileNode
|
|
5
|
+
from .dshell_file import dshell_write_file
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
'dshell_get_pastbin'
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
async def dshell_get_pastbin(ctx: Message, code: StrNode) -> FileNode:
|
|
13
|
+
"""
|
|
14
|
+
Get a pastbin from a code snippet.
|
|
15
|
+
Return a FileNode to stream the result
|
|
16
|
+
"""
|
|
17
|
+
_CMD = "gp"
|
|
18
|
+
|
|
19
|
+
_validate_required_string(code, "code", _CMD)
|
|
20
|
+
|
|
21
|
+
content = FileNode(name=StrNode(f"Pastbin {code}"))
|
|
22
|
+
|
|
23
|
+
with get(f"https://pastebin.com/raw/{code}", stream=True, timeout=10) as response:
|
|
24
|
+
|
|
25
|
+
if not response.ok:
|
|
26
|
+
raise Exception(f"Failed to retrieve pastbin with code {code} !")
|
|
27
|
+
|
|
28
|
+
for line in response.iter_lines(decode_unicode=True, chunk_size=1024):
|
|
29
|
+
await dshell_write_file(ctx, StrNode(line), append=BoolNode(1), file=content)
|
|
30
|
+
|
|
31
|
+
return content
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
from Dshell.full_import import (
|
|
1
|
+
from Dshell.full_import import (
|
|
2
|
+
Any,
|
|
3
|
+
randint,
|
|
4
|
+
Optional,
|
|
5
|
+
Union,
|
|
6
|
+
Embed,
|
|
7
|
+
Member,
|
|
8
|
+
Role,
|
|
9
|
+
PermissionOverwrite,
|
|
10
|
+
getsizeof,
|
|
11
|
+
Invite)
|
|
2
12
|
from ..DshellTokenizer.dshell_token_type import Token
|
|
3
13
|
from ..DshellInterpreteur.dshell_global_variables import MAX_STR_SIZE, MAX_LIST_SIZE, MAX_FILE_SIZE
|
|
4
14
|
from .errors import *
|
|
@@ -9,7 +19,6 @@ __all__ = [
|
|
|
9
19
|
'IntNode',
|
|
10
20
|
'FloatNode',
|
|
11
21
|
'BoolNode',
|
|
12
|
-
'LengthNode',
|
|
13
22
|
'StartNode',
|
|
14
23
|
'ElseNode',
|
|
15
24
|
'ElifNode',
|
|
@@ -52,8 +61,13 @@ class ASTNode:
|
|
|
52
61
|
def __getattr__(self, item):
|
|
53
62
|
raise AttributeError(f"'{type(self).__name__}' node has no attribute '{item}'")
|
|
54
63
|
|
|
64
|
+
class DATANode:
|
|
65
|
+
"""
|
|
66
|
+
Base class for all Data nodes created during execution
|
|
67
|
+
"""
|
|
68
|
+
|
|
55
69
|
|
|
56
|
-
class StrNode(str, ASTNode):
|
|
70
|
+
class StrNode(str, ASTNode, DATANode):
|
|
57
71
|
|
|
58
72
|
def __new__(cls, value: Any):
|
|
59
73
|
cls.pointer = 0
|
|
@@ -115,7 +129,7 @@ class StrNode(str, ASTNode):
|
|
|
115
129
|
def __repr__(self):
|
|
116
130
|
return StrNode(f"{super().__repr__()}")
|
|
117
131
|
|
|
118
|
-
class IntNode(int, ASTNode):
|
|
132
|
+
class IntNode(int, ASTNode, DATANode):
|
|
119
133
|
def __new__(cls, value: Union[str, StrNode, int, "IntNode", float, "FloatNode"], base: int = 10):
|
|
120
134
|
if isinstance(value, (int, IntNode, float, FloatNode)):
|
|
121
135
|
return super().__new__(cls, value)
|
|
@@ -127,7 +141,7 @@ class IntNode(int, ASTNode):
|
|
|
127
141
|
def __sizeof__(self):
|
|
128
142
|
return getsizeof(IntNode)
|
|
129
143
|
|
|
130
|
-
class FloatNode(float, ASTNode):
|
|
144
|
+
class FloatNode(float, ASTNode, DATANode):
|
|
131
145
|
def __new__(cls, value: Union[str, StrNode, float, "FloatNode", int, IntNode]):
|
|
132
146
|
return super().__new__(cls, value)
|
|
133
147
|
|
|
@@ -137,7 +151,7 @@ class FloatNode(float, ASTNode):
|
|
|
137
151
|
def __sizeof__(self):
|
|
138
152
|
return getsizeof(FloatNode)
|
|
139
153
|
|
|
140
|
-
class BoolNode(int, ASTNode):
|
|
154
|
+
class BoolNode(int, ASTNode, DATANode):
|
|
141
155
|
def __new__(cls, value: Union[str, StrNode, int, IntNode, bool, "BoolNode"]):
|
|
142
156
|
return super().__new__(cls, int(bool(value)))
|
|
143
157
|
|
|
@@ -396,30 +410,6 @@ class VarNode(ASTNode):
|
|
|
396
410
|
"body": [token.to_dict() for token in self.body]
|
|
397
411
|
}
|
|
398
412
|
|
|
399
|
-
class LengthNode(ASTNode):
|
|
400
|
-
"""
|
|
401
|
-
Node representing the length operation in the AST.
|
|
402
|
-
"""
|
|
403
|
-
|
|
404
|
-
def __init__(self, body: Token, line: int):
|
|
405
|
-
"""
|
|
406
|
-
:param body: list of tokens representing the body of the length operation
|
|
407
|
-
"""
|
|
408
|
-
super().__init__(line)
|
|
409
|
-
self.body = body
|
|
410
|
-
|
|
411
|
-
def __repr__(self):
|
|
412
|
-
return StrNode(f"<LENGTH> - {self.body}")
|
|
413
|
-
|
|
414
|
-
def to_dict(self):
|
|
415
|
-
"""
|
|
416
|
-
Convert the LengthNode to a dictionary representation.
|
|
417
|
-
:return: Dictionary representation of the LengthNode.
|
|
418
|
-
"""
|
|
419
|
-
return {
|
|
420
|
-
"type": "LengthNode",
|
|
421
|
-
"body": self.body.to_dict()
|
|
422
|
-
}
|
|
423
413
|
|
|
424
414
|
class EndNode(ASTNode):
|
|
425
415
|
"""
|
|
@@ -558,6 +548,7 @@ class PermissionNode(ASTNode):
|
|
|
558
548
|
def __repr__(self):
|
|
559
549
|
return StrNode(f"<PERMISSION> - {self.value}")
|
|
560
550
|
|
|
551
|
+
|
|
561
552
|
class SleepNode(ASTNode):
|
|
562
553
|
"""
|
|
563
554
|
Node representing a sleep command in the AST.
|
|
@@ -841,7 +832,7 @@ class OptionUiSelectNode(ASTNode):
|
|
|
841
832
|
"body": [token.to_dict() for token in self.body]
|
|
842
833
|
}
|
|
843
834
|
|
|
844
|
-
class FileNode(
|
|
835
|
+
class FileNode(DATANode):
|
|
845
836
|
def __init__(self, name: Optional[StrNode] = None, description: Optional[StrNode] = None, spoiler: bool = False):
|
|
846
837
|
super().__init__(0)
|
|
847
838
|
self.name = name
|
|
@@ -877,7 +868,7 @@ class FileNode(ASTNode):
|
|
|
877
868
|
def __repr__(self):
|
|
878
869
|
return StrNode(f"<FILE> - {self.name}")
|
|
879
870
|
|
|
880
|
-
class FileStreamNode(
|
|
871
|
+
class FileStreamNode(DATANode):
|
|
881
872
|
|
|
882
873
|
def __init__(self, file: FileNode, separator: Optional[StrNode] = None):
|
|
883
874
|
super().__init__(-1)
|
|
@@ -927,7 +918,7 @@ class FileStreamNode(ASTNode):
|
|
|
927
918
|
return self.file.size()
|
|
928
919
|
|
|
929
920
|
|
|
930
|
-
class ListNode(ASTNode):
|
|
921
|
+
class ListNode(ASTNode, DATANode):
|
|
931
922
|
"""
|
|
932
923
|
Node representing a list structure in the AST.
|
|
933
924
|
Iterable class for browsing lists created from Dshell code.
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellPreProcess/dshell_preprocess.py
RENAMED
|
@@ -3,6 +3,10 @@ from ..full_import import sub, MULTILINE, StrEnum, search, compile, DOTALL
|
|
|
3
3
|
class PreProcessorInstructions(StrEnum):
|
|
4
4
|
DEFINE = "define"
|
|
5
5
|
|
|
6
|
+
@classmethod
|
|
7
|
+
def contain(cls, key: str, /) -> bool:
|
|
8
|
+
return any(member.value == key for member in cls)
|
|
9
|
+
|
|
6
10
|
class PreProcessorData:
|
|
7
11
|
def __init__(self, instruction: str, symbol: str, value: str):
|
|
8
12
|
self.instruction = instruction
|
|
@@ -37,7 +41,7 @@ def preProcessor(code: list[str]) -> list[str]:
|
|
|
37
41
|
instruction: str = pre_processor_match.group(1).lower()
|
|
38
42
|
symbol: str = pre_processor_match.group(2)
|
|
39
43
|
value: str = pre_processor_match.group(3)
|
|
40
|
-
if instruction
|
|
44
|
+
if PreProcessorInstructions.contain(instruction):
|
|
41
45
|
pre_processor_data.append(PreProcessorData(instruction, symbol, value))
|
|
42
46
|
|
|
43
47
|
else:
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_tokenizer.py
RENAMED
|
@@ -115,7 +115,7 @@ class DshellTokenizer:
|
|
|
115
115
|
tokens_per_line.append(token)
|
|
116
116
|
|
|
117
117
|
if token_type == DTT.STR:
|
|
118
|
-
token.value = sub(backslash_pattern,
|
|
118
|
+
token.value = sub(backslash_pattern, r"\1", token.value)
|
|
119
119
|
|
|
120
120
|
len_match = len(match.group(0))
|
|
121
121
|
line = line[:start_match] + MASK_CHARACTER * len_match + line[end_match:]
|
|
@@ -5,7 +5,6 @@ from copy import deepcopy
|
|
|
5
5
|
from pycordViews import EasyModifiedViews, SelectMenu
|
|
6
6
|
from pycordViews.views.errors import CustomIDNotFound
|
|
7
7
|
from datetime import timedelta, datetime, UTC
|
|
8
|
-
from requests import get
|
|
9
8
|
|
|
10
9
|
from discord.ui import Button, Select
|
|
11
10
|
from discord import *
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dshellInterpreter
|
|
3
|
-
Version: 1.2.7.
|
|
3
|
+
Version: 1.2.7.6
|
|
4
4
|
Summary: A Discord bot interpreter for creating custom commands and automations.
|
|
5
5
|
Home-page: https://github.com/BOXERRMD/Dshell_Interpreter
|
|
6
6
|
Author: Chronos
|
|
@@ -11,7 +11,7 @@ Project-URL: Source, https://github.com/BOXERRMD/Dshell_Interpreter
|
|
|
11
11
|
Keywords: discord bot interpreter automation commands
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: py-cord==2.6.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dshellInterpreter
|
|
3
|
-
Version: 1.2.7.
|
|
3
|
+
Version: 1.2.7.6
|
|
4
4
|
Summary: A Discord bot interpreter for creating custom commands and automations.
|
|
5
5
|
Home-page: https://github.com/BOXERRMD/Dshell_Interpreter
|
|
6
6
|
Author: Chronos
|
|
@@ -11,7 +11,7 @@ Project-URL: Source, https://github.com/BOXERRMD/Dshell_Interpreter
|
|
|
11
11
|
Keywords: discord bot interpreter automation commands
|
|
12
12
|
Classifier: Programming Language :: Python :: 3
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.11
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: py-cord==2.6.1
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="1.2.7.
|
|
8
|
+
version="1.2.7.6",
|
|
9
9
|
author="Chronos",
|
|
10
10
|
author_email="vagabonwalybi@gmail.com",
|
|
11
11
|
description="A Discord bot interpreter for creating custom commands and automations.",
|
|
@@ -24,7 +24,7 @@ setup(
|
|
|
24
24
|
"Programming Language :: Python :: 3",
|
|
25
25
|
"Operating System :: OS Independent",
|
|
26
26
|
],
|
|
27
|
-
python_requires='>=3.
|
|
27
|
+
python_requires='>=3.11',
|
|
28
28
|
license="MIT",
|
|
29
29
|
keywords="discord bot interpreter automation commands",
|
|
30
30
|
project_urls={
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
from Dshell.full_import import get, Message
|
|
2
|
-
from .utils.utils_type_validation import _validate_required_string
|
|
3
|
-
from ..DshellParser.ast_nodes import StrNode, ListNode
|
|
4
|
-
|
|
5
|
-
__all__ = [
|
|
6
|
-
'dshell_get_pastbin'
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
async def dshell_get_pastbin(ctx: Message, code: StrNode) -> ListNode:
|
|
11
|
-
"""
|
|
12
|
-
Get a pastbin from a code snippet.
|
|
13
|
-
"""
|
|
14
|
-
_CMD = "gp"
|
|
15
|
-
|
|
16
|
-
_validate_required_string(ctx, code, _CMD)
|
|
17
|
-
|
|
18
|
-
content = ListNode([]) # Initialize content to an empty string
|
|
19
|
-
|
|
20
|
-
with get(f"https://pastebin.com/raw/{code}", stream=True, timeout=10) as response:
|
|
21
|
-
|
|
22
|
-
if not response.ok:
|
|
23
|
-
raise Exception(f"Failed to retrieve pastbin with code {code} !")
|
|
24
|
-
|
|
25
|
-
for line in response.iter_lines(decode_unicode=True, chunk_size=512):
|
|
26
|
-
content.add(StrNode(line))
|
|
27
|
-
|
|
28
|
-
return content
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_channel.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_embed.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_message.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/dshell_ui.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_embed.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_file.py
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DISCORD_COMMANDS/utils/utils_list.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
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/cached_messages.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellInterpreteur/dshell_scope.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellParser/dshell_parser.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_keywords.py
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/Dshell/DshellTokenizer/dshell_token_type.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-1.2.7.4 → dshellinterpreter-1.2.7.6}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|