dshellInterpreter 0.2.4.4__tar.gz → 0.2.5__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.
Potentially problematic release.
This version of dshellInterpreter might be problematic. Click here for more details.
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_member.py +59 -3
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_role.py +4 -0
- {dshellinterpreter-0.2.4.4/dshellInterpreter.egg-info → dshellinterpreter-0.2.5}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5/dshellInterpreter.egg-info}/PKG-INFO +1 -1
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/setup.py +1 -1
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellInterpreteur/__init__.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellInterpreteur/dshell_interpreter.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellParser/__init__.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellParser/ast_nodes.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellParser/dshell_parser.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/__init__.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/__init__.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_utils.py +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/LICENSE +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/README.md +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/requires.txt +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/top_level.txt +0 -0
- {dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/setup.cfg +0 -0
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_member.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from datetime import timedelta, datetime
|
|
1
|
+
from datetime import timedelta, datetime, UTC
|
|
2
2
|
|
|
3
|
-
from discord import MISSING, Message, Member, Permissions
|
|
3
|
+
from discord import MISSING, Message, Member, Permissions, Role
|
|
4
4
|
|
|
5
5
|
__all__ = [
|
|
6
6
|
"dshell_ban_member",
|
|
@@ -78,7 +78,7 @@ async def dshell_timeout_member(ctx: Message, duration: int, member=None, reason
|
|
|
78
78
|
if duration < 0:
|
|
79
79
|
raise ValueError("Duration must be a non-negative integer.")
|
|
80
80
|
|
|
81
|
-
await target_member.timeout(until=datetime.now() + timedelta(seconds=duration), reason=reason)
|
|
81
|
+
await target_member.timeout(until=datetime.now(UTC) + timedelta(seconds=duration), reason=reason)
|
|
82
82
|
|
|
83
83
|
return target_member.id
|
|
84
84
|
|
|
@@ -184,3 +184,59 @@ async def dshell_move_member(ctx: Message, member=None, channel=None, disconnect
|
|
|
184
184
|
await target_member.move_to(target_channel, reason=reason)
|
|
185
185
|
|
|
186
186
|
return target_member.id
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
async def dshell_give_member_roles(ctx: Message, roles, member=None, reason=None):
|
|
190
|
+
"""
|
|
191
|
+
Give roles to the target member
|
|
192
|
+
"""
|
|
193
|
+
target_member = ctx.author if member is None else ctx.guild.get_member(member)
|
|
194
|
+
|
|
195
|
+
if target_member is None:
|
|
196
|
+
raise Exception(f'Member {member} not found in the server !')
|
|
197
|
+
|
|
198
|
+
if isinstance(roles, int):
|
|
199
|
+
roles = (roles, )
|
|
200
|
+
|
|
201
|
+
list_roles: list[Role] = []
|
|
202
|
+
for i in roles:
|
|
203
|
+
role_to_give = ctx.guild.get_role(i)
|
|
204
|
+
|
|
205
|
+
if role_to_give is None:
|
|
206
|
+
raise Exception(f'Role {i} not found in the server !')
|
|
207
|
+
|
|
208
|
+
list_roles.append(role_to_give)
|
|
209
|
+
|
|
210
|
+
list_roles.extend(target_member.roles)
|
|
211
|
+
|
|
212
|
+
await target_member.edit(roles=roles, reason=str(reason))
|
|
213
|
+
|
|
214
|
+
return target_member.id
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
async def dshell_remove_member_roles(ctx: Message, roles, member=None, reason=None):
|
|
218
|
+
"""
|
|
219
|
+
Remove roles to the target member
|
|
220
|
+
"""
|
|
221
|
+
target_member = ctx.author if member is None else ctx.guild.get_member(member)
|
|
222
|
+
|
|
223
|
+
if target_member is None:
|
|
224
|
+
raise Exception(f'Member {member} not found in the server !')
|
|
225
|
+
|
|
226
|
+
if isinstance(roles, int):
|
|
227
|
+
roles = (roles,)
|
|
228
|
+
|
|
229
|
+
list_roles: set[Role] = set()
|
|
230
|
+
for i in roles:
|
|
231
|
+
role_to_give = target_member.get_role(i)
|
|
232
|
+
|
|
233
|
+
if role_to_give is None:
|
|
234
|
+
raise Exception(f"{target_member.name} member doesn't have {i} role !")
|
|
235
|
+
|
|
236
|
+
list_roles.add(role_to_give)
|
|
237
|
+
|
|
238
|
+
new_set_role = list(list_roles - set(target_member.roles))
|
|
239
|
+
|
|
240
|
+
await target_member.edit(roles=new_set_role, reason=str(reason))
|
|
241
|
+
|
|
242
|
+
return target_member.id
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_role.py
RENAMED
|
@@ -71,6 +71,8 @@ async def dshell_delete_roles(ctx: Message, roles, reason=None):
|
|
|
71
71
|
|
|
72
72
|
await role_to_delete.delete(reason=str(reason))
|
|
73
73
|
|
|
74
|
+
return role_to_delete.id
|
|
75
|
+
|
|
74
76
|
|
|
75
77
|
async def dshell_edit_role(ctx: Message,
|
|
76
78
|
role,
|
|
@@ -121,3 +123,5 @@ async def dshell_edit_role(ctx: Message,
|
|
|
121
123
|
mentionable=mentionable if mentionable is not None else role_to_edit.mentionable,
|
|
122
124
|
position=position if position is not None else role_to_edit.position,
|
|
123
125
|
reason=str(reason))
|
|
126
|
+
|
|
127
|
+
return role_to_edit.id
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="dshellInterpreter",
|
|
8
|
-
version="0.2.
|
|
8
|
+
version="0.2.5",
|
|
9
9
|
author="Chronos",
|
|
10
10
|
author_email="vagabonwalybi@gmail.com",
|
|
11
11
|
description="A Discord bot interpreter for creating custom commands and automations.",
|
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_channel.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_message.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellInterpreteur/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_keywords.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_token_type.py
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/Dshell/_DshellTokenizer/dshell_tokenizer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/requires.txt
RENAMED
|
File without changes
|
{dshellinterpreter-0.2.4.4 → dshellinterpreter-0.2.5}/dshellInterpreter.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|