cordscript 1.0.0__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.
Files changed (37) hide show
  1. cordscript/__init__.py +6 -0
  2. cordscript/client.py +590 -0
  3. cordscript/core/__init__.py +9 -0
  4. cordscript/core/context.py +33 -0
  5. cordscript/core/runtime.py +55 -0
  6. cordscript/core/variables.py +16 -0
  7. cordscript/exceptions/__init__.py +3 -0
  8. cordscript/exceptions/errors.py +9 -0
  9. cordscript/functions/__init__.py +45 -0
  10. cordscript/functions/database/__init__.py +4 -0
  11. cordscript/functions/database/database.py +846 -0
  12. cordscript/functions/database/store.py +69 -0
  13. cordscript/functions/discord/__init__.py +15 -0
  14. cordscript/functions/discord/components.py +134 -0
  15. cordscript/functions/discord/componentsv2.py +92 -0
  16. cordscript/functions/discord/embed.py +63 -0
  17. cordscript/functions/discord/interaction.py +48 -0
  18. cordscript/functions/discord/logic.py +87 -0
  19. cordscript/functions/discord/message.py +51 -0
  20. cordscript/functions/discord/moderation.py +179 -0
  21. cordscript/functions/discord/status.py +56 -0
  22. cordscript/functions/users/__init__.py +3 -0
  23. cordscript/functions/users/user.py +103 -0
  24. cordscript/functions/utility/__init__.py +14 -0
  25. cordscript/functions/utility/cooldown.py +35 -0
  26. cordscript/functions/utility/http.py +73 -0
  27. cordscript/functions/utility/json.py +201 -0
  28. cordscript/functions/utility/math.py +102 -0
  29. cordscript/functions/utility/random.py +27 -0
  30. cordscript/functions/utility/strings.py +201 -0
  31. cordscript/functions/utility/time.py +41 -0
  32. cordscript/parser.py +190 -0
  33. cordscript/setup.py +38 -0
  34. cordscript-1.0.0.dist-info/METADATA +17 -0
  35. cordscript-1.0.0.dist-info/RECORD +37 -0
  36. cordscript-1.0.0.dist-info/WHEEL +5 -0
  37. cordscript-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,16 @@
1
+ from __future__ import annotations
2
+
3
+
4
+ class VariableStore:
5
+ def __init__(self):
6
+ self._vars: dict[str, str] = {}
7
+ self._split_cache: list[str] = []
8
+
9
+ def get(self, name: str) -> str:
10
+ return self._vars.get(name, "")
11
+
12
+ def set(self, name: str, value: str):
13
+ self._vars[name] = value
14
+
15
+ def all(self) -> dict[str, str]:
16
+ return self._vars
@@ -0,0 +1,3 @@
1
+ from .errors import StopExecution, CooldownError
2
+
3
+ __all__ = ["StopExecution", "CooldownError"]
@@ -0,0 +1,9 @@
1
+ from __future__ import annotations
2
+
3
+
4
+ class StopExecution(Exception):
5
+ pass
6
+
7
+
8
+ class CooldownError(Exception):
9
+ pass
@@ -0,0 +1,45 @@
1
+ from .discord import (
2
+ handle_message,
3
+ handle_interaction,
4
+ handle_embed,
5
+ handle_components,
6
+ handle_componentsv2,
7
+ handle_logic,
8
+ handle_moderation,
9
+ handle_status,
10
+ _flush_select,
11
+ _flush_row,
12
+ )
13
+ from .users import handle_user
14
+ from .database import handle_database
15
+ from .utility import (
16
+ handle_math,
17
+ handle_time,
18
+ handle_random,
19
+ handle_http,
20
+ handle_cooldown,
21
+ handle_json,
22
+ handle_strings,
23
+ )
24
+
25
+ __all__ = [
26
+ "handle_message",
27
+ "handle_interaction",
28
+ "handle_embed",
29
+ "handle_components",
30
+ "handle_componentsv2",
31
+ "handle_logic",
32
+ "handle_moderation",
33
+ "handle_status",
34
+ "_flush_select",
35
+ "_flush_row",
36
+ "handle_user",
37
+ "handle_database",
38
+ "handle_math",
39
+ "handle_time",
40
+ "handle_random",
41
+ "handle_http",
42
+ "handle_cooldown",
43
+ "handle_json",
44
+ "handle_strings",
45
+ ]
@@ -0,0 +1,4 @@
1
+ from .database import handle_database, connect_from_url, _init_table
2
+ from .store import Database
3
+
4
+ __all__ = ["handle_database", "connect_from_url", "_init_table", "Database"]