dshellInterpreter 0.2.16.1__py3-none-any.whl → 0.2.16.2__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/DISCORD_COMMANDS/utils/utils_global.py +2 -2
- Dshell/DISCORD_COMMANDS/utils/utils_member.py +6 -3
- Dshell/DISCORD_COMMANDS/utils/utils_permissions.py +1 -1
- {dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/METADATA +1 -1
- {dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/RECORD +8 -8
- {dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/WHEEL +0 -0
- {dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/licenses/LICENSE +0 -0
- {dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/top_level.txt +0 -0
|
@@ -127,7 +127,7 @@ async def utils_get_roles(ctx: Message, value: int):
|
|
|
127
127
|
|
|
128
128
|
guild = ctx.guild
|
|
129
129
|
|
|
130
|
-
what_is = utils_what_discord_type_is(ctx, value)
|
|
130
|
+
what_is, member = utils_what_discord_type_is(ctx, value)
|
|
131
131
|
|
|
132
132
|
if what_is == DiscordType.UNKNOWN:
|
|
133
133
|
raise ValueError(f"{value} member not found in guild {guild.name}")
|
|
@@ -136,4 +136,4 @@ async def utils_get_roles(ctx: Message, value: int):
|
|
|
136
136
|
raise TypeError(f"value must be a member id in roles command, not {what_is}")
|
|
137
137
|
|
|
138
138
|
from ..._DshellParser.ast_nodes import ListNode
|
|
139
|
-
return ListNode([i.id for i in
|
|
139
|
+
return ListNode([i.id for i in member.roles])
|
|
@@ -5,7 +5,7 @@ from discord import Message, PermissionOverwrite
|
|
|
5
5
|
|
|
6
6
|
from .utils_global import utils_what_discord_type_is, DiscordType
|
|
7
7
|
|
|
8
|
-
async def utils_has_permissions(ctx: Message, member: int, permission: PermissionOverwrite) -> bool:
|
|
8
|
+
async def utils_has_permissions(ctx: Message, member: int, permission: dict[None, PermissionOverwrite]) -> bool:
|
|
9
9
|
"""
|
|
10
10
|
Return True if the member has the specified permissions.
|
|
11
11
|
:param member:
|
|
@@ -16,12 +16,15 @@ async def utils_has_permissions(ctx: Message, member: int, permission: Permissio
|
|
|
16
16
|
if not isinstance(member, int):
|
|
17
17
|
raise TypeError(f"member must be an int in has_perms command, not {type(member)}")
|
|
18
18
|
|
|
19
|
-
if not isinstance(permission,
|
|
19
|
+
if not isinstance(permission, dict):
|
|
20
20
|
raise TypeError(f"permissions must be a permission bloc in has_perms command, not {type(permission)}")
|
|
21
21
|
|
|
22
|
+
if None not in permission:
|
|
23
|
+
raise ValueError(f"permissions must have simple 'allow' permission in has_perms command, not {permission.keys()}")
|
|
24
|
+
|
|
22
25
|
discord_type, member = utils_what_discord_type_is(ctx, member)
|
|
23
26
|
|
|
24
27
|
if discord_type != DiscordType.MEMBER:
|
|
25
28
|
raise ValueError(f"No member found with ID {member} in has_perms command.")
|
|
26
29
|
|
|
27
|
-
return (member.guild_permissions & permission.pair()[0]) == permission.pair()[0]
|
|
30
|
+
return (member.guild_permissions & permission[None].pair()[0]) == permission[None].pair()[0]
|
|
@@ -39,7 +39,7 @@ class DshellPermissions:
|
|
|
39
39
|
return instance
|
|
40
40
|
raise ValueError(f"No role found with ID {role_id} in perm command.")
|
|
41
41
|
|
|
42
|
-
def get_permission_overwrite(self, guild: Guild) -> dict[Union[Member, Role], PermissionOverwrite]:
|
|
42
|
+
def get_permission_overwrite(self, guild: Guild) -> dict[Union[Member, Role, None], PermissionOverwrite]:
|
|
43
43
|
"""
|
|
44
44
|
Returns a PermissionOverwrite object with member and role permissions.
|
|
45
45
|
If no members or roles are specified, it returns a PermissionOverwrite with None key.
|
|
@@ -8,11 +8,11 @@ Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=zcWl6Y1W31h9MTHS-j9tLDwcrRiE_wG
|
|
|
8
8
|
Dshell/DISCORD_COMMANDS/dshell_pastbin.py,sha256=H0tUJOwdzYBXvxqipK3mzoNZUKrSLcVm4EZlWbBRScs,796
|
|
9
9
|
Dshell/DISCORD_COMMANDS/dshell_role.py,sha256=t_yRZRD0FKE2gT4dIDIsHz2PSZZztDVEkkqkG_OkNh4,5002
|
|
10
10
|
Dshell/DISCORD_COMMANDS/utils/__init__.py,sha256=-amNcYysjgx3YDpDSnbQmJhnm3lbJere9K9aDH-YnJg,115
|
|
11
|
-
Dshell/DISCORD_COMMANDS/utils/utils_global.py,sha256=
|
|
11
|
+
Dshell/DISCORD_COMMANDS/utils/utils_global.py,sha256=48WpW4Vkdz1ITjCQzmnqKej-1kE71CTY0fB65k2OyWw,4213
|
|
12
12
|
Dshell/DISCORD_COMMANDS/utils/utils_list.py,sha256=zqImMWvD-1UnbPP1TZewnvZpq7qs1sOTT1YhbJ5I8h8,3160
|
|
13
|
-
Dshell/DISCORD_COMMANDS/utils/utils_member.py,sha256=
|
|
13
|
+
Dshell/DISCORD_COMMANDS/utils/utils_member.py,sha256=1EoHooxwijc7AFJGnuae3ccjQk0x69MELtZ5ES5abLY,1165
|
|
14
14
|
Dshell/DISCORD_COMMANDS/utils/utils_message.py,sha256=cQvJ15f49ddOjybARwkJKNFe3ITYQciF-pZHERFPkr0,2964
|
|
15
|
-
Dshell/DISCORD_COMMANDS/utils/utils_permissions.py,sha256=
|
|
15
|
+
Dshell/DISCORD_COMMANDS/utils/utils_permissions.py,sha256=qfuD_kvzf2J8gHAB4lPO0eOsCjEN-Z3mBTGLEyUoJlk,3467
|
|
16
16
|
Dshell/DISCORD_COMMANDS/utils/utils_thread.py,sha256=tVl4msEwrWHY-0AytI6eY3JSs-eIFUigDSJfK9mT1ww,1457
|
|
17
17
|
Dshell/_DshellInterpreteur/__init__.py,sha256=xy5-J-R3YmY99JF3NBHTRRLsComFxpjnCA5xacISctU,35
|
|
18
18
|
Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=Us9eLIUbaKC5rRkPRjGWHlX9ZEFNYeOnwEW_w7LwPhI,28665
|
|
@@ -23,8 +23,8 @@ Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8q
|
|
|
23
23
|
Dshell/_DshellTokenizer/dshell_keywords.py,sha256=crzX16IbcYCVqxgzz3NvN0-FzKtBjZcZQvtHqdxhDGk,6787
|
|
24
24
|
Dshell/_DshellTokenizer/dshell_token_type.py,sha256=gYIb2XN2YcgeRgmar_rBDS5CGmwfmxihu8mOW_d6lbE,1533
|
|
25
25
|
Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=AJnUocD6hbU6wvjRAN5uDha5QQieTwXlHzZVtgRGaZQ,7307
|
|
26
|
-
dshellinterpreter-0.2.16.
|
|
27
|
-
dshellinterpreter-0.2.16.
|
|
28
|
-
dshellinterpreter-0.2.16.
|
|
29
|
-
dshellinterpreter-0.2.16.
|
|
30
|
-
dshellinterpreter-0.2.16.
|
|
26
|
+
dshellinterpreter-0.2.16.2.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
|
|
27
|
+
dshellinterpreter-0.2.16.2.dist-info/METADATA,sha256=EfKRsFozLGg77g8qtXSv1-zkBSMmzImGggnRR0GZwaY,1151
|
|
28
|
+
dshellinterpreter-0.2.16.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
+
dshellinterpreter-0.2.16.2.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
|
|
30
|
+
dshellinterpreter-0.2.16.2.dist-info/RECORD,,
|
|
File without changes
|
{dshellinterpreter-0.2.16.1.dist-info → dshellinterpreter-0.2.16.2.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|