dshellInterpreter 0.2.11__tar.gz → 0.2.13__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.
Files changed (30) hide show
  1. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/dshell_channel.py +28 -28
  2. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellInterpreteur/dshell_interpreter.py +1 -0
  3. {dshellinterpreter-0.2.11/dshellInterpreter.egg-info → dshellinterpreter-0.2.13}/PKG-INFO +1 -1
  4. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13/dshellInterpreter.egg-info}/PKG-INFO +1 -1
  5. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/setup.py +1 -1
  6. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  7. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
  8. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/dshell_message.py +0 -0
  9. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
  10. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
  11. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/utils/__init__.py +0 -0
  12. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/utils/utils_message.py +0 -0
  13. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/DISCORD_COMMANDS/utils/utils_thread.py +0 -0
  14. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellInterpreteur/__init__.py +0 -0
  15. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellParser/__init__.py +0 -0
  16. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellParser/ast_nodes.py +0 -0
  17. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellParser/dshell_parser.py +0 -0
  18. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellTokenizer/__init__.py +0 -0
  19. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellTokenizer/dshell_keywords.py +0 -0
  20. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
  21. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
  22. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/__init__.py +0 -0
  23. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/Dshell/_utils.py +0 -0
  24. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/LICENSE +0 -0
  25. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/README.md +0 -0
  26. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  27. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  28. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/dshellInterpreter.egg-info/requires.txt +0 -0
  29. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/dshellInterpreter.egg-info/top_level.txt +0 -0
  30. {dshellinterpreter-0.2.11 → dshellinterpreter-0.2.13}/setup.cfg +0 -0
@@ -103,22 +103,22 @@ async def dshell_create_text_channel(ctx: Message,
103
103
  slowmode=MISSING,
104
104
  topic=MISSING,
105
105
  nsfw=MISSING,
106
- permission: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
106
+ permissions: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
107
107
  reason=None):
108
108
  """
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)
@@ -129,7 +129,7 @@ async def dshell_create_text_channel(ctx: Message,
129
129
  slowmode_delay=slowmode,
130
130
  topic=topic,
131
131
  nsfw=nsfw,
132
- overwrites=permission,
132
+ overwrites=permissions,
133
133
  reason=reason)
134
134
 
135
135
  return created_channel.id
@@ -140,15 +140,15 @@ async def dshell_create_voice_channel(ctx: Message,
140
140
  category=None,
141
141
  position=MISSING,
142
142
  bitrate=MISSING,
143
- permission: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
143
+ permissions: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
144
144
  reason=None):
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)
@@ -157,7 +157,7 @@ async def dshell_create_voice_channel(ctx: Message,
157
157
  category=channel_category,
158
158
  position=position,
159
159
  bitrate=bitrate,
160
- overwrites=permission,
160
+ overwrites=permissions,
161
161
  reason=reason)
162
162
 
163
163
  return created_channel.id
@@ -210,22 +210,22 @@ async def dshell_edit_text_channel(ctx: Message,
210
210
  slowmode=MISSING,
211
211
  topic=MISSING,
212
212
  nsfw=MISSING,
213
- permission: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
213
+ permissions: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
214
214
  reason=None):
215
215
  """
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)
@@ -238,7 +238,7 @@ async def dshell_edit_text_channel(ctx: Message,
238
238
  slowmode_delay=slowmode if slowmode is not MISSING else channel_to_edit.slowmode_delay,
239
239
  topic=topic if topic is not MISSING else channel_to_edit.topic,
240
240
  nsfw=nsfw if nsfw is not MISSING else channel_to_edit.nsfw,
241
- overwrites=permission if permission is not MISSING else channel_to_edit.overwrites,
241
+ overwrites=permissions if permissions is not MISSING else channel_to_edit.overwrites,
242
242
  reason=reason)
243
243
 
244
244
  return channel_to_edit.id
@@ -249,15 +249,15 @@ async def dshell_edit_voice_channel(ctx: Message,
249
249
  name=None,
250
250
  position=MISSING,
251
251
  bitrate=MISSING,
252
- permission: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
252
+ permissions: dict[Union[Member, Role], PermissionOverwrite] = MISSING,
253
253
  reason=None):
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)
@@ -268,7 +268,7 @@ async def dshell_edit_voice_channel(ctx: Message,
268
268
  await channel_to_edit.edit(name=name if name is not None else channel_to_edit.name,
269
269
  position=position if position is not MISSING else channel_to_edit.position,
270
270
  bitrate=bitrate if bitrate is not MISSING else channel_to_edit.bitrate,
271
- overwrites=permission if permission is not MISSING else channel_to_edit.overwrites,
271
+ overwrites=permissions if permissions is not MISSING else channel_to_edit.overwrites,
272
272
  reason=reason)
273
273
 
274
274
  return channel_to_edit.id
@@ -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 !")
@@ -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.11
3
+ Version: 0.2.13
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.11
3
+ Version: 0.2.13
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.11",
8
+ version="0.2.13",
9
9
  author="Chronos",
10
10
  author_email="vagabonwalybi@gmail.com",
11
11
  description="A Discord bot interpreter for creating custom commands and automations.",