dshellInterpreter 0.2.10.6__tar.gz → 0.2.12__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.

Files changed (30) hide show
  1. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/dshell_channel.py +20 -20
  2. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/dshell_message.py +1 -1
  3. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellInterpreteur/dshell_interpreter.py +1 -0
  4. {dshellinterpreter-0.2.10.6/dshellInterpreter.egg-info → dshellinterpreter-0.2.12}/PKG-INFO +1 -1
  5. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12/dshellInterpreter.egg-info}/PKG-INFO +1 -1
  6. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/setup.py +1 -1
  7. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  8. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
  9. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
  10. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
  11. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
  12. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
  13. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
  14. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellInterpreteur/__init__.py +0 -0
  15. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellParser/__init__.py +0 -0
  16. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellParser/ast_nodes.py +0 -0
  17. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellParser/dshell_parser.py +0 -0
  18. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellTokenizer/__init__.py +0 -0
  19. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
  20. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
  21. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
  22. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/__init__.py +0 -0
  23. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/Dshell/_utils.py +0 -0
  24. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/LICENSE +0 -0
  25. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/README.md +0 -0
  26. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  27. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  28. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/dshellInterpreter.egg-info/requires.txt +0 -0
  29. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/dshellInterpreter.egg-info/top_level.txt +0 -0
  30. {dshellinterpreter-0.2.10.6 → dshellinterpreter-0.2.12}/setup.cfg +0 -0
@@ -109,16 +109,16 @@ async def dshell_create_text_channel(ctx: Message,
109
109
  Creates a text channel on the server
110
110
  """
111
111
 
112
- if not isinstance(position, _MissingSentinel) and not isinstance(position, int):
112
+ if not isinstance(position, (_MissingSentinel, int)):
113
113
  raise Exception(f"Position must be an integer, not {type(position)} !")
114
114
 
115
- if not isinstance(slowmode, _MissingSentinel) and not isinstance(slowmode, int):
115
+ if not isinstance(slowmode, (_MissingSentinel, int)):
116
116
  raise Exception(f"Slowmode must be an integer, not {type(slowmode)} !")
117
117
 
118
- if not isinstance(topic, _MissingSentinel) and not isinstance(topic, str):
118
+ if not isinstance(topic, (_MissingSentinel, str)):
119
119
  raise Exception(f"Topic must be a string, not {type(topic)} !")
120
120
 
121
- if not isinstance(nsfw, _MissingSentinel) and not isinstance(nsfw, bool):
121
+ if not isinstance(nsfw, (_MissingSentinel, bool)):
122
122
  raise Exception(f"NSFW must be a boolean, not {type(nsfw)} !")
123
123
 
124
124
  channel_category = ctx.channel.category if category is None else ctx.channel.guild.get_channel(category)
@@ -145,10 +145,10 @@ async def dshell_create_voice_channel(ctx: Message,
145
145
  """
146
146
  Creates a voice channel on the server
147
147
  """
148
- if not isinstance(position, _MissingSentinel) and not isinstance(position, int):
148
+ if not isinstance(position, (_MissingSentinel, int)):
149
149
  raise Exception(f"Position must be an integer, not {type(position)} !")
150
150
 
151
- if not isinstance(bitrate, _MissingSentinel) and not isinstance(bitrate, int):
151
+ if not isinstance(bitrate, (_MissingSentinel, int)):
152
152
  raise Exception(f"Bitrate must be an integer, not {type(bitrate)} !")
153
153
 
154
154
  channel_category = ctx.channel.category if category is None else ctx.channel.guild.get_channel(category)
@@ -216,16 +216,16 @@ async def dshell_edit_text_channel(ctx: Message,
216
216
  Edits a text channel on the server
217
217
  """
218
218
 
219
- if not isinstance(position, _MissingSentinel) and not isinstance(position, int):
219
+ if not isinstance(position, (_MissingSentinel, int)):
220
220
  raise Exception(f"Position must be an integer, not {type(position)} !")
221
221
 
222
- if not isinstance(slowmode, _MissingSentinel) and not isinstance(slowmode, int):
222
+ if not isinstance(slowmode, (_MissingSentinel, int)):
223
223
  raise Exception(f"Slowmode must be an integer, not {type(slowmode)} !")
224
224
 
225
- if not isinstance(topic, _MissingSentinel) and not isinstance(topic, str):
225
+ if not isinstance(topic, (_MissingSentinel, str)):
226
226
  raise Exception(f"Topic must be a string, not {type(topic)} !")
227
227
 
228
- if not isinstance(nsfw, _MissingSentinel) and not isinstance(nsfw, bool):
228
+ if not isinstance(nsfw, (_MissingSentinel, bool)):
229
229
  raise Exception(f"NSFW must be a boolean, not {type(nsfw)} !")
230
230
 
231
231
  channel_to_edit = ctx.channel if channel is None else ctx.channel.guild.get_channel(channel)
@@ -254,10 +254,10 @@ async def dshell_edit_voice_channel(ctx: Message,
254
254
  """
255
255
  Edits a voice channel on the server
256
256
  """
257
- if not isinstance(position, _MissingSentinel) and not isinstance(position, int):
257
+ if not isinstance(position, (_MissingSentinel, int)):
258
258
  raise Exception(f"Position must be an integer, not {type(position)} !")
259
259
 
260
- if not isinstance(bitrate, _MissingSentinel) and not isinstance(bitrate, int):
260
+ if not isinstance(bitrate, (_MissingSentinel, int)):
261
261
  raise Exception(f"Bitrate must be an integer, not {type(bitrate)} !")
262
262
 
263
263
  channel_to_edit = ctx.channel if channel is None else ctx.channel.guild.get_channel(channel)
@@ -292,19 +292,19 @@ async def dshell_create_thread_message(ctx: Message,
292
292
  if not isinstance(name, str):
293
293
  raise Exception(f"Name must be a string, not {type(name)} !")
294
294
 
295
- if not isinstance(archive, _MissingSentinel) and not isinstance(archive, int):
295
+ if not isinstance(archive, (_MissingSentinel, int)):
296
296
  raise Exception(f"Auto archive duration must be an integer, not {type(archive)} !")
297
297
 
298
298
  if not isinstance(archive, _MissingSentinel) and archive not in (60, 1440, 4320, 10080):
299
299
  raise Exception("Auto archive duration must be one of the following values: 60, 1440, 4320, 10080 !")
300
300
 
301
- if not isinstance(slowmode, _MissingSentinel) and not isinstance(slowmode, int):
301
+ if not isinstance(slowmode, (_MissingSentinel, int)):
302
302
  raise Exception(f"Slowmode delay must be an integer, not {type(slowmode)} !")
303
303
 
304
304
  if not isinstance(slowmode, _MissingSentinel) and slowmode < 0:
305
305
  raise Exception("Slowmode delay must be a positive integer !")
306
306
 
307
- thread = await message.create_thread(name=name,
307
+ thread = await message.fetch().create_thread(name=name,
308
308
  auto_archive_duration=archive,
309
309
  slowmode_delay=slowmode)
310
310
 
@@ -326,16 +326,16 @@ async def dshell_edit_thread(ctx: Message,
326
326
 
327
327
  thread = await utils_get_thread(ctx, thread)
328
328
 
329
- if not isinstance(name, _MissingSentinel) and not isinstance(name, str):
329
+ if not isinstance(name, (_MissingSentinel, str)):
330
330
  raise Exception(f"Name must be a string, not {type(name)} !")
331
331
 
332
- if not isinstance(archive, _MissingSentinel) and not isinstance(archive, int):
332
+ if not isinstance(archive, (_MissingSentinel, int)):
333
333
  raise Exception(f"Auto archive duration must be an integer, not {type(archive)} !")
334
334
 
335
335
  if not isinstance(archive, _MissingSentinel) and archive not in (60, 1440, 4320, 10080):
336
336
  raise Exception("Auto archive duration must be one of the following values: 60, 1440, 4320, 10080 !")
337
337
 
338
- if not isinstance(slowmode, _MissingSentinel) and not isinstance(slowmode, int):
338
+ if not isinstance(slowmode, (_MissingSentinel, int)):
339
339
  raise Exception(f"Slowmode delay must be an integer, not {type(slowmode)} !")
340
340
 
341
341
  if not isinstance(slowmode, _MissingSentinel) and slowmode < 0:
@@ -355,7 +355,7 @@ async def dshell_get_thread(ctx: Message, message: Union[int, str] = None):
355
355
  if message is None:
356
356
  message = ctx.id
357
357
 
358
- message = await utils_get_message(ctx, message)
358
+ message = await utils_get_message(ctx, message).fetch()
359
359
 
360
360
  if not hasattr(message, 'thread'):
361
361
  return None
@@ -376,7 +376,7 @@ async def dshell_delete_thread(ctx: Message, thread: Union[int, str] = None, rea
376
376
  if thread is None:
377
377
  thread = ctx.id
378
378
 
379
- thread = await utils_get_message(ctx, thread)
379
+ thread = await utils_get_message(ctx, thread).fetch()
380
380
 
381
381
  if not hasattr(thread, 'thread'):
382
382
  raise Exception("The specified message does not have a thread !")
@@ -25,7 +25,7 @@ async def dshell_send_message(ctx: Message, message=None, delete=None, channel=N
25
25
  """
26
26
  Sends a message on Discord
27
27
  """
28
- return -1
28
+
29
29
  if delete is not None and not isinstance(delete, (int, float)):
30
30
  raise Exception(f'Delete parameter must be a number (seconds) or None, not {type(delete)} !')
31
31
 
@@ -338,6 +338,7 @@ def regroupe_commandes(body: list[Token], interpreter: DshellInterpreteur) -> li
338
338
  type_=DTT.SEPARATOR, value=body[i].value, position=body[i].position)
339
339
  ] + body[i + 1:], interpreter
340
340
  ) # add a sub-dictionary for sub-commands
341
+ i += len(body[i:])
341
342
  # return list_tokens
342
343
 
343
344
  elif (body[i].type == DTT.SEPARATOR and
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.2.10.6
3
+ Version: 0.2.12
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.2.10.6
3
+ Version: 0.2.12
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
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name="dshellInterpreter",
8
- version="0.2.10.6",
8
+ version="0.2.12",
9
9
  author="Chronos",
10
10
  author_email="vagabonwalybi@gmail.com",
11
11
  description="A Discord bot interpreter for creating custom commands and automations.",