dshellInterpreter 0.2.5.3__tar.gz → 0.2.6__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 (27) hide show
  1. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/dshell_message.py +35 -2
  2. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellTokenizer/dshell_keywords.py +2 -0
  3. {dshellinterpreter-0.2.5.3/dshellInterpreter.egg-info → dshellinterpreter-0.2.6}/PKG-INFO +1 -1
  4. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6/dshellInterpreter.egg-info}/PKG-INFO +1 -1
  5. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/setup.py +1 -1
  6. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/__init__.py +0 -0
  7. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/dshell_channel.py +0 -0
  8. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/dshell_member.py +0 -0
  9. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/dshell_pastbin.py +0 -0
  10. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/DISCORD_COMMANDS/dshell_role.py +0 -0
  11. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellInterpreteur/__init__.py +0 -0
  12. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellInterpreteur/dshell_interpreter.py +0 -0
  13. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellParser/__init__.py +0 -0
  14. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellParser/ast_nodes.py +0 -0
  15. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellParser/dshell_parser.py +0 -0
  16. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellTokenizer/__init__.py +0 -0
  17. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellTokenizer/dshell_token_type.py +0 -0
  18. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_DshellTokenizer/dshell_tokenizer.py +0 -0
  19. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/__init__.py +0 -0
  20. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/Dshell/_utils.py +0 -0
  21. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/LICENSE +0 -0
  22. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/README.md +0 -0
  23. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/dshellInterpreter.egg-info/SOURCES.txt +0 -0
  24. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/dshellInterpreter.egg-info/dependency_links.txt +0 -0
  25. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/dshellInterpreter.egg-info/requires.txt +0 -0
  26. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/dshellInterpreter.egg-info/top_level.txt +0 -0
  27. {dshellinterpreter-0.2.5.3 → dshellinterpreter-0.2.6}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  from re import search
2
2
 
3
- from discord import Embed, Message
3
+ from discord import Embed, Message, NotFound
4
4
  from discord.ext import commands
5
5
 
6
6
  __all__ = [
@@ -11,7 +11,9 @@ __all__ = [
11
11
  'dshell_get_hystory_messages',
12
12
  'dshell_research_regex_in_content',
13
13
  'dshell_add_reactions',
14
- 'dshell_remove_reactions'
14
+ 'dshell_remove_reactions',
15
+ 'dshell_clear_message_reactions',
16
+ 'dshell_clear_one_reactions'
15
17
  ]
16
18
 
17
19
 
@@ -165,3 +167,34 @@ async def dshell_remove_reactions(ctx: Message, reactions, message=None):
165
167
  await message.clear_reaction(reaction)
166
168
 
167
169
  return message.id
170
+
171
+ async def dshell_clear_message_reactions(ctx: Message, message):
172
+ """
173
+ Clear all reaction on the target message
174
+ """
175
+ if not isinstance(message, int):
176
+ raise Exception(f'Message must be integer, not {type(message)}')
177
+
178
+ target_message = await ctx.channel.fetch_message(message)
179
+
180
+ if target_message is None:
181
+ raise Exception(f'Message not found !')
182
+
183
+ await target_message.clear_reactions()
184
+
185
+ async def dshell_clear_one_reactions(ctx: Message, message, emoji):
186
+ """
187
+ Clear one emoji on the target message
188
+ """
189
+ if not isinstance(message, int):
190
+ raise Exception(f'Message must be integer, not {type(message)}')
191
+
192
+ if not isinstance(emoji, str):
193
+ raise Exception(f'Emoji must be string, not {type(emoji)}')
194
+
195
+ try:
196
+ target_message = await ctx.channel.fetch_message(message)
197
+ except NotFound:
198
+ raise Exception(f'Message not found !')
199
+
200
+ await target_message.clear_reaction(emoji)
@@ -58,6 +58,8 @@ dshell_commands: dict[str, Callable] = {
58
58
 
59
59
  "ar": dshell_add_reactions, # add reactions to a message
60
60
  "rr": dshell_remove_reactions, # remove reactions from a message
61
+ "cmr": dshell_clear_message_reactions,
62
+ "cor": dshell_clear_one_reactions
61
63
 
62
64
  }
63
65
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dshellInterpreter
3
- Version: 0.2.5.3
3
+ Version: 0.2.6
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.5.3
3
+ Version: 0.2.6
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.5.3",
8
+ version="0.2.6",
9
9
  author="Chronos",
10
10
  author_email="vagabonwalybi@gmail.com",
11
11
  description="A Discord bot interpreter for creating custom commands and automations.",