dshellInterpreter 0.2.13.10__py3-none-any.whl → 0.2.13.12__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.
Potentially problematic release.
This version of dshellInterpreter might be problematic. Click here for more details.
- Dshell/_DshellInterpreteur/dshell_interpreter.py +18 -16
- {dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/METADATA +1 -1
- {dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/RECORD +6 -6
- {dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/WHEEL +0 -0
- {dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/licenses/LICENSE +0 -0
- {dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/top_level.txt +0 -0
|
@@ -21,6 +21,7 @@ from .._DshellTokenizer.dshell_tokenizer import DshellTokenizer
|
|
|
21
21
|
All_nodes = TypeVar('All_nodes', IfNode, LoopNode, ElseNode, ElifNode, ArgsCommandNode, VarNode, IdentOperationNode)
|
|
22
22
|
context = TypeVar('context', AutoShardedBot, Message, PrivateChannel, Interaction)
|
|
23
23
|
ButtonStyleValues: tuple = tuple(i.name for i in ButtonStyle)
|
|
24
|
+
print(ButtonStyleValues)
|
|
24
25
|
|
|
25
26
|
class DshellInterpreteur:
|
|
26
27
|
"""
|
|
@@ -37,24 +38,25 @@ class DshellInterpreteur:
|
|
|
37
38
|
:param vars: Optional dictionary of variables to initialize in the interpreter's environment.
|
|
38
39
|
"""
|
|
39
40
|
self.ast: list[ASTNode] = parse(DshellTokenizer(code).start(), StartNode([]))[0]
|
|
41
|
+
message = ctx.message if isinstance(ctx, Interaction) else ctx
|
|
40
42
|
self.env: dict[str, Any] = {
|
|
41
43
|
'__ret__': None, # environment variables, '__ret__' is used to store the return value of commands
|
|
42
|
-
'__guild__':
|
|
43
|
-
'__channel__':
|
|
44
|
-
'__author__':
|
|
45
|
-
'__author_display_name__':
|
|
46
|
-
'__author_avatar__':
|
|
47
|
-
'__author_discriminator__':
|
|
48
|
-
'__author_bot__':
|
|
49
|
-
'__author_nick__':
|
|
50
|
-
'__author_id__':
|
|
51
|
-
'__message__':
|
|
52
|
-
'__message_id__':
|
|
53
|
-
'__channel_name__':
|
|
54
|
-
'__channel_type__':
|
|
55
|
-
'__channel_id__':
|
|
56
|
-
'__private_channel__': isinstance(
|
|
57
|
-
} if
|
|
44
|
+
'__guild__': message.channel.guild.name,
|
|
45
|
+
'__channel__': message.channel.name,
|
|
46
|
+
'__author__': message.author.name,
|
|
47
|
+
'__author_display_name__': message.author.display_name,
|
|
48
|
+
'__author_avatar__': message.author.display_avatar.url if message.author.display_avatar else None,
|
|
49
|
+
'__author_discriminator__': message.author.discriminator,
|
|
50
|
+
'__author_bot__': message.author.bot,
|
|
51
|
+
'__author_nick__': message.author.nick if hasattr(message.author, 'nick') else None,
|
|
52
|
+
'__author_id__': message.author.id,
|
|
53
|
+
'__message__': message.content,
|
|
54
|
+
'__message_id__': message.id,
|
|
55
|
+
'__channel_name__': message.channel.name,
|
|
56
|
+
'__channel_type__': message.channel.type.name if hasattr(message.channel, 'type') else None,
|
|
57
|
+
'__channel_id__': message.channel.id,
|
|
58
|
+
'__private_channel__': isinstance(message.channel, PrivateChannel),
|
|
59
|
+
} if message is not None else {}
|
|
58
60
|
self.vars = vars if vars is not None else ''
|
|
59
61
|
self.ctx: context = ctx
|
|
60
62
|
if debug:
|
|
@@ -10,7 +10,7 @@ Dshell/DISCORD_COMMANDS/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
10
10
|
Dshell/DISCORD_COMMANDS/utils/utils_message.py,sha256=Pn0ljyeCvRfY4tlWHrSbIsxSFZZ5J4lDaeVme3WHp9o,1239
|
|
11
11
|
Dshell/DISCORD_COMMANDS/utils/utils_thread.py,sha256=tVl4msEwrWHY-0AytI6eY3JSs-eIFUigDSJfK9mT1ww,1457
|
|
12
12
|
Dshell/_DshellInterpreteur/__init__.py,sha256=xy5-J-R3YmY99JF3NBHTRRLsComFxpjnCA5xacISctU,35
|
|
13
|
-
Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=
|
|
13
|
+
Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=0PSoLIXDoQLuWGHGaBv3h0sq-ajNnGg57v4WSRaAeCk,27039
|
|
14
14
|
Dshell/_DshellParser/__init__.py,sha256=ONDfhZMvClqP_6tE8SLjp-cf3pXL-auQYnfYRrHZxC4,56
|
|
15
15
|
Dshell/_DshellParser/ast_nodes.py,sha256=CXUG0rIJNh4jzMCgCcRqmQwU0WQoESQ-5FkuVtZZndM,17717
|
|
16
16
|
Dshell/_DshellParser/dshell_parser.py,sha256=73eKwY7iBzBtL6n2IxJcvtSz0xkfE5y1qEffZ2YfXXY,16913
|
|
@@ -18,8 +18,8 @@ Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8q
|
|
|
18
18
|
Dshell/_DshellTokenizer/dshell_keywords.py,sha256=upwwXwS0OaYhDTAnXSpem2-L4boMEYRncKK315Z5rwI,5744
|
|
19
19
|
Dshell/_DshellTokenizer/dshell_token_type.py,sha256=gYIb2XN2YcgeRgmar_rBDS5CGmwfmxihu8mOW_d6lbE,1533
|
|
20
20
|
Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=LZGs4Ytuyx9Galazqtz32lS4Mmu9yZya1B7AzFQAQOk,7150
|
|
21
|
-
dshellinterpreter-0.2.13.
|
|
22
|
-
dshellinterpreter-0.2.13.
|
|
23
|
-
dshellinterpreter-0.2.13.
|
|
24
|
-
dshellinterpreter-0.2.13.
|
|
25
|
-
dshellinterpreter-0.2.13.
|
|
21
|
+
dshellinterpreter-0.2.13.12.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
|
|
22
|
+
dshellinterpreter-0.2.13.12.dist-info/METADATA,sha256=2uFhzKyF6S3Ojbla85JXOM7XQou4W6TRh6I-owhJ304,1152
|
|
23
|
+
dshellinterpreter-0.2.13.12.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
dshellinterpreter-0.2.13.12.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
|
|
25
|
+
dshellinterpreter-0.2.13.12.dist-info/RECORD,,
|
|
File without changes
|
{dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.13.10.dist-info → dshellinterpreter-0.2.13.12.dist-info}/top_level.txt
RENAMED
|
File without changes
|