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

@@ -2,7 +2,7 @@ from asyncio import sleep
2
2
  from re import search
3
3
  from typing import Union
4
4
 
5
- from discord import MISSING, PermissionOverwrite, Member, Role, Message, CategoryChannel
5
+ from discord import MISSING, PermissionOverwrite, Member, Role, Message, CategoryChannel, PartialMessage
6
6
  from discord.utils import _MissingSentinel
7
7
 
8
8
  from .utils.utils_message import utils_get_message
@@ -320,7 +320,11 @@ async def dshell_create_thread_message(ctx: Message,
320
320
  if not isinstance(slowmode, _MissingSentinel) and slowmode < 0:
321
321
  raise Exception("Slowmode delay must be a positive integer !")
322
322
 
323
- m = await message.fetch()
323
+ if isinstance(message, PartialMessage):
324
+ m = await message.fetch()
325
+ else:
326
+ m = message
327
+
324
328
  thread = await m.create_thread(name=name,
325
329
  auto_archive_duration=archive,
326
330
  slowmode_delay=slowmode)
@@ -372,7 +376,11 @@ async def dshell_get_thread(ctx: Message, message: Union[int, str] = None):
372
376
  if message is None:
373
377
  message = ctx.id
374
378
 
375
- message = await utils_get_message(ctx, message).fetch()
379
+ target_message = utils_get_message(ctx, message)
380
+ if isinstance(target_message, PartialMessage):
381
+ message = await target_message.fetch()
382
+ else:
383
+ message = target_message
376
384
 
377
385
  if not hasattr(message, 'thread'):
378
386
  return None
@@ -393,7 +401,11 @@ async def dshell_delete_thread(ctx: Message, thread: Union[int, str] = None, rea
393
401
  if thread is None:
394
402
  thread = ctx.id
395
403
 
396
- thread = await utils_get_message(ctx, thread).fetch()
404
+ target_message = utils_get_message(ctx, thread)
405
+ if isinstance(target_message, PartialMessage):
406
+ thread = await target_message.fetch()
407
+ else:
408
+ thread = target_message
397
409
 
398
410
  if not hasattr(thread, 'thread'):
399
411
  raise Exception("The specified message does not have a thread !")
@@ -1,6 +1,6 @@
1
1
  from re import search
2
2
 
3
- from discord import Embed, Message
3
+ from discord import Embed, Message, PartialMessage
4
4
  from discord.ext import commands
5
5
 
6
6
  from pycordViews import EasyModifiedViews
@@ -258,10 +258,13 @@ async def dshell_get_content_message(ctx: Message, message=None):
258
258
 
259
259
  target_message = ctx if message is None else utils_get_message(ctx, message)
260
260
 
261
- try:
262
- fetch_target_message = await target_message.fetch()
263
- except:
264
- raise Exception(f'Message not found !')
261
+ if isinstance(target_message, PartialMessage):
262
+ try:
263
+ fetch_target_message = await target_message.fetch()
264
+ except:
265
+ raise Exception(f'Message not found !')
266
+ else:
267
+ fetch_target_message = target_message
265
268
 
266
269
  return fetch_target_message.content
267
270
 
@@ -4,7 +4,7 @@ from re import search
4
4
 
5
5
  from ..._DshellInterpreteur.cached_messages import dshell_cached_messages
6
6
 
7
- def utils_get_message(ctx: Message, message: Union[int, str]) -> Union[PartialMessage]:
7
+ def utils_get_message(ctx: Message, message: Union[int, str]) -> Union[PartialMessage, Message]:
8
8
  """
9
9
  Returns the message object of the specified message ID or link.
10
10
  Message is only available in the same server as the command and in the same channel.
@@ -89,8 +89,14 @@ async def utils_get_author_id_message(ctx: Message, message: Optional[int] = Non
89
89
 
90
90
  target_message = ctx
91
91
  if message is not None:
92
- try:
93
- target_message = await utils_get_message(ctx, message).fetch()
94
- except:
95
- raise Exception(f"[message_author] Author ID message to get is not found !")
92
+ target_message = utils_get_message(ctx, message)
93
+
94
+ if isinstance(target_message, PartialMessage):
95
+ try:
96
+ target_message = await target_message.fetch()
97
+ except:
98
+ raise Exception(f"[message_author] Author ID message to get is not found !")
99
+ else:
100
+ target_message = ctx
101
+
96
102
  return target_message.author.id
@@ -208,8 +208,6 @@ class DshellInterpreteur:
208
208
  else:
209
209
  raise DshellInterpreterStopExecution()
210
210
 
211
- dshell_cached_messages.reset()
212
-
213
211
  async def eval_data_token(self, token: Token):
214
212
  """
215
213
  Eval a data token and returns its value in Python.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.2.19.3
3
+ Version: 0.2.19.5
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,23 +1,23 @@
1
1
  Dshell/__init__.py,sha256=gEgfeYoyHn4bUepMd0F-MSx36rR8WgQGxNpgDKo2qbA,136
2
2
  Dshell/_utils.py,sha256=PJ3fwn8IMqUMnW9oTwfr9v4--rzHIhhLQoVVqjwjoJU,23
3
3
  Dshell/DISCORD_COMMANDS/__init__.py,sha256=87-YpGU74m-m7AqUQni7PGbw73JRlioQkywW_61Whms,208
4
- Dshell/DISCORD_COMMANDS/dshell_channel.py,sha256=Dy2RnoGzxZGNFvD6QErP74NdVXtfgu55w2ARJEmuUGI,18695
4
+ Dshell/DISCORD_COMMANDS/dshell_channel.py,sha256=d3eqGZb-gITc-1GIjs1YJmNSDl7p7tCQhwPWjDAlHtk,19069
5
5
  Dshell/DISCORD_COMMANDS/dshell_interaction.py,sha256=5FA8JZ2_v98ZzOZl6EKyjo_fUQC7FuK6C6hij6ZSP30,3495
6
6
  Dshell/DISCORD_COMMANDS/dshell_member.py,sha256=5Iw-2dydhYMZOw2nx0svZP9JpZWHOXC0qkL9tClJHtw,8840
7
- Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=1fRbHduh44ovxjulFGepRqS9YBHAFvj_QovQL0NDt6E,9426
7
+ Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=54QmduZooXm8GJ9bzb2kkHPgcFzFeVUeBXy-zoJuuH0,9568
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=X5F-fFCXD8Y7sia0b2q-7Fr1-MJj-aL5EupT-bAejzc,234
11
11
  Dshell/DISCORD_COMMANDS/utils/utils_global.py,sha256=G_gH9iF6roT-0QR2FUZj6_P1ADr06JrxZgELOy9yIP8,4768
12
12
  Dshell/DISCORD_COMMANDS/utils/utils_list.py,sha256=zqImMWvD-1UnbPP1TZewnvZpq7qs1sOTT1YhbJ5I8h8,3160
13
13
  Dshell/DISCORD_COMMANDS/utils/utils_member.py,sha256=1EoHooxwijc7AFJGnuae3ccjQk0x69MELtZ5ES5abLY,1165
14
- Dshell/DISCORD_COMMANDS/utils/utils_message.py,sha256=IPSjvEvJ_8UY3PfAVMlgj6AJthLCRfpZRL1aV8D7SrU,4139
14
+ Dshell/DISCORD_COMMANDS/utils/utils_message.py,sha256=OZEsil6yG-PYT4vHFCjTWa3gziwDE-vFfPny4Us3Nb0,4314
15
15
  Dshell/DISCORD_COMMANDS/utils/utils_permissions.py,sha256=wBtdKRLkNSgKgfu7tURdiehdcO-npXUvnVx9D82HudM,3593
16
16
  Dshell/DISCORD_COMMANDS/utils/utils_string.py,sha256=2LvJG_PR_VkPdnsw0vKNTwhEQGNog-3gFd_rZIUpGKc,4709
17
17
  Dshell/DISCORD_COMMANDS/utils/utils_thread.py,sha256=tVl4msEwrWHY-0AytI6eY3JSs-eIFUigDSJfK9mT1ww,1457
18
18
  Dshell/_DshellInterpreteur/__init__.py,sha256=87b2ljRcSbs2Wbebn72eAiOGTF5ye6qud5w3cP4sCgk,111
19
19
  Dshell/_DshellInterpreteur/cached_messages.py,sha256=BJuITd--iITD95MMuwCWVo2HPPlolIZ5FZVSLkTLVD4,156
20
- Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=B0MUD1v1NPjq5-acR3OG9QZt9J3zmk8vmPw836JT7jY,30848
20
+ Dshell/_DshellInterpreteur/dshell_interpreter.py,sha256=VwaBOx_rV1PMEYzkRPl62ZYbd-6Nk6_oCvdoKnYblXM,30806
21
21
  Dshell/_DshellInterpreteur/errors.py,sha256=0PJz_VYZfNZeKR_PEHxw3tRkgKNNUerV0wwrq2r1luA,250
22
22
  Dshell/_DshellParser/__init__.py,sha256=ONDfhZMvClqP_6tE8SLjp-cf3pXL-auQYnfYRrHZxC4,56
23
23
  Dshell/_DshellParser/ast_nodes.py,sha256=vsY_-uGqbB03Bi556QnRM98kx6oOeJFMe9TaAX2Zcz0,19627
@@ -26,8 +26,8 @@ Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8q
26
26
  Dshell/_DshellTokenizer/dshell_keywords.py,sha256=jPNUVJ4egBVQ3yMx0Tv0fOS3WHwPJA4XbB4OUy-5uCg,6266
27
27
  Dshell/_DshellTokenizer/dshell_token_type.py,sha256=bkug7eBKjYofkOGmwzPnAH9rQlU14cO0PelZbT0kGoQ,1544
28
28
  Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=aSXdzEyhqoYYLpMLsLwRpeQPp84PA1F5cjm9O1EYBQs,7350
29
- dshellinterpreter-0.2.19.3.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
30
- dshellinterpreter-0.2.19.3.dist-info/METADATA,sha256=IHENtj1cHWzGUm8SK8PpJE1C4djGOGDRCeUdr3yOyWQ,1151
31
- dshellinterpreter-0.2.19.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
- dshellinterpreter-0.2.19.3.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
33
- dshellinterpreter-0.2.19.3.dist-info/RECORD,,
29
+ dshellinterpreter-0.2.19.5.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
30
+ dshellinterpreter-0.2.19.5.dist-info/METADATA,sha256=g9RE3IiveerLDkEfNC6Y988oMDfLLQp4Q-4dfOA1qo8,1151
31
+ dshellinterpreter-0.2.19.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
32
+ dshellinterpreter-0.2.19.5.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
33
+ dshellinterpreter-0.2.19.5.dist-info/RECORD,,