dshellInterpreter 0.2.4.2__py3-none-any.whl → 0.2.4.4__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.

@@ -1,5 +1,6 @@
1
1
  from discord import MISSING, Message, PermissionOverwrite
2
2
  from discord.utils import _MissingSentinel
3
+ from .._utils import NoneType
3
4
 
4
5
  __all__ = [
5
6
  'dshell_create_role',
@@ -26,7 +27,8 @@ async def dshell_create_role(ctx: Message,
26
27
 
27
28
  from .._DshellInterpreteur.dshell_interpreter import build_colour
28
29
 
29
- colour = build_colour(color)
30
+ if not isinstance(color, _MissingSentinel):
31
+ color = build_colour(color)
30
32
 
31
33
  if not isinstance(hoist, (bool, _MissingSentinel)):
32
34
  raise Exception(f"Hoist must be a boolean, not {type(permissions)} !")
@@ -41,7 +43,7 @@ async def dshell_create_role(ctx: Message,
41
43
 
42
44
  created_role = await ctx.guild.create_role(name=name,
43
45
  permissions=permissions,
44
- colour=colour,
46
+ colour=color,
45
47
  hoist=hoist,
46
48
  mentionable=mentionable,
47
49
  reason=str(reason))
@@ -87,10 +89,10 @@ async def dshell_edit_role(ctx: Message,
87
89
 
88
90
  role_to_edit = ctx.guild.get_role(role)
89
91
 
90
- if not isinstance(name, (str, None)):
92
+ if not isinstance(name, (str, NoneType)):
91
93
  raise Exception(f"Name must be a string, not {type(name)} !")
92
94
 
93
- if not isinstance(permissions, (dict, None)):
95
+ if not isinstance(permissions, (dict, NoneType)):
94
96
  raise Exception(f"Permissions must be a PermissionNode, not {type(permissions)} !")
95
97
 
96
98
  if isinstance(permissions, dict):
@@ -100,20 +102,21 @@ async def dshell_edit_role(ctx: Message,
100
102
 
101
103
  from .._DshellInterpreteur.dshell_interpreter import build_colour
102
104
 
103
- colour = build_colour(color)
105
+ if color is not None:
106
+ color = build_colour(color)
104
107
 
105
- if not isinstance(hoist, (bool, None)):
108
+ if not isinstance(hoist, (bool, NoneType)):
106
109
  raise Exception(f"Hoist must be a boolean, not {type(permissions)} !")
107
110
 
108
- if not isinstance(mentionable, (bool, None)):
111
+ if not isinstance(mentionable, (bool, NoneType)):
109
112
  raise Exception(f"Mentionable must be a boolean, not {type(permissions)} !")
110
113
 
111
- if not isinstance(position, (int, None)):
114
+ if not isinstance(position, (int, NoneType)):
112
115
  raise Exception(f"Position must be an integer, not {type(permissions)} !")
113
116
 
114
117
  await role_to_edit.edit(name=name if name is not None else role_to_edit.name,
115
118
  permissions=permissions if permissions is not None else role_to_edit.permissions,
116
- colour=colour if color is not None else role_to_edit.colour,
119
+ colour=color if color is not None else role_to_edit.colour,
117
120
  hoist=hoist if hoist is not None else role_to_edit.hoist,
118
121
  mentionable=mentionable if mentionable is not None else role_to_edit.mentionable,
119
122
  position=position if position is not None else role_to_edit.position,
Dshell/__init__.py CHANGED
@@ -1 +1,2 @@
1
1
  from ._DshellInterpreteur.dshell_interpreter import DshellInterpreteur
2
+ from ._utils import *
Dshell/_utils.py ADDED
@@ -0,0 +1 @@
1
+ NoneType = type(None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.2.4.2
3
+ Version: 0.2.4.4
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
@@ -1,10 +1,11 @@
1
- Dshell/__init__.py,sha256=UPvXnewe_8FX9aoevMA78UN1k8AY-u8LTY3vEVxaDxw,72
1
+ Dshell/__init__.py,sha256=pGd94FPy8kVXH_jH566HhApQPhbPfMPnZXzH_0dPWh0,93
2
+ Dshell/_utils.py,sha256=PJ3fwn8IMqUMnW9oTwfr9v4--rzHIhhLQoVVqjwjoJU,23
2
3
  Dshell/DISCORD_COMMANDS/__init__.py,sha256=_oo_aMEju4gZg-MIbF8bKMVM6CWAF0AO9DxAlemaXMw,149
3
4
  Dshell/DISCORD_COMMANDS/dshell_channel.py,sha256=2qnbI2tUu5sowJVOVkY4p-l6Gu-5Gw9BEP3MItScvV8,8939
4
5
  Dshell/DISCORD_COMMANDS/dshell_member.py,sha256=KEdI14VTmDJm3zb4Mt-cFe71Jdsrolj6O8673Vzw4n8,5943
5
6
  Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=fLxj_Ns-krZgXEPijhWvBFLorvmbleR6JpVOR72BIa8,5180
6
7
  Dshell/DISCORD_COMMANDS/dshell_pastbin.py,sha256=TkWFGRRTvhhJgvwkDFx9Fz4UM2UUFwxyq0laMVx0mUk,881
7
- Dshell/DISCORD_COMMANDS/dshell_role.py,sha256=vpf3v_FLdkeQdWL_7eW5P4M-Tk0sKndvOZ-tkRnjCBg,4777
8
+ Dshell/DISCORD_COMMANDS/dshell_role.py,sha256=KUoyBf4xNvg0ahlM_l5gePfaOfwJ8rImfT3JnQsIeMM,4908
8
9
  Dshell/_DshellInterpreteur/__init__.py,sha256=xy5-J-R3YmY99JF3NBHTRRLsComFxpjnCA5xacISctU,35
9
10
  Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=dJS8frzNhKEvs-WdC7kwcZMZKefraWO4t8vLrFctjvA,22805
10
11
  Dshell/_DshellParser/__init__.py,sha256=ONDfhZMvClqP_6tE8SLjp-cf3pXL-auQYnfYRrHZxC4,56
@@ -14,8 +15,8 @@ Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8q
14
15
  Dshell/_DshellTokenizer/dshell_keywords.py,sha256=G9qdXr-d05QtmBdwTGa1qMDm7TDbIEkbx_-ERU97Ods,4664
15
16
  Dshell/_DshellTokenizer/dshell_token_type.py,sha256=pWzvmj6EFGkDwNHooOAjdyysi1vZRVEostFIZSW1Ais,1483
16
17
  Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=-EhwrfbcOcnAxOHWBE89531t25u6c6HmJuT1AKFn9Ew,7032
17
- dshellinterpreter-0.2.4.2.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
18
- dshellinterpreter-0.2.4.2.dist-info/METADATA,sha256=bw76lXZufFvvnfLChu23WIeXbHFcCuaUHPeheYP7RF0,1122
19
- dshellinterpreter-0.2.4.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- dshellinterpreter-0.2.4.2.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
21
- dshellinterpreter-0.2.4.2.dist-info/RECORD,,
18
+ dshellinterpreter-0.2.4.4.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
19
+ dshellinterpreter-0.2.4.4.dist-info/METADATA,sha256=V122a3qdmtpQ3UzZa0b2Ql0rGXx1sWJfZxmWef6LwY8,1122
20
+ dshellinterpreter-0.2.4.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ dshellinterpreter-0.2.4.4.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
22
+ dshellinterpreter-0.2.4.4.dist-info/RECORD,,