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

@@ -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
@@ -3,7 +3,7 @@ Dshell/_utils.py,sha256=PJ3fwn8IMqUMnW9oTwfr9v4--rzHIhhLQoVVqjwjoJU,23
3
3
  Dshell/DISCORD_COMMANDS/__init__.py,sha256=_oo_aMEju4gZg-MIbF8bKMVM6CWAF0AO9DxAlemaXMw,149
4
4
  Dshell/DISCORD_COMMANDS/dshell_channel.py,sha256=2qnbI2tUu5sowJVOVkY4p-l6Gu-5Gw9BEP3MItScvV8,8939
5
5
  Dshell/DISCORD_COMMANDS/dshell_member.py,sha256=L3Ud4nza_55n9R02kfL-iNK9ybBczx6SDkccUTWxv3s,7646
6
- Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=fLxj_Ns-krZgXEPijhWvBFLorvmbleR6JpVOR72BIa8,5180
6
+ Dshell/DISCORD_COMMANDS/dshell_message.py,sha256=SvX9I4nYMWm8ACE56QJBM5yEiZoXIKbTLkIOyrENd5o,6253
7
7
  Dshell/DISCORD_COMMANDS/dshell_pastbin.py,sha256=TkWFGRRTvhhJgvwkDFx9Fz4UM2UUFwxyq0laMVx0mUk,881
8
8
  Dshell/DISCORD_COMMANDS/dshell_role.py,sha256=fotsYWGHebgIx157q-zRbcCd90Y7jIuKCZ8udQoEzSU,4970
9
9
  Dshell/_DshellInterpreteur/__init__.py,sha256=xy5-J-R3YmY99JF3NBHTRRLsComFxpjnCA5xacISctU,35
@@ -12,11 +12,11 @@ Dshell/_DshellParser/__init__.py,sha256=ONDfhZMvClqP_6tE8SLjp-cf3pXL-auQYnfYRrHZ
12
12
  Dshell/_DshellParser/ast_nodes.py,sha256=2qwL_M0ELPia6L6gqwgV5hqprvyuo97cx3Zk2dVz09U,15341
13
13
  Dshell/_DshellParser/dshell_parser.py,sha256=bdnVhx-MchM61J88fa9PimpAdwPtQumywJd-GoMqS8Q,15514
14
14
  Dshell/_DshellTokenizer/__init__.py,sha256=LIQSRhDx2B9pmPx5ADMwwD0Xr9ybneVLhHH8qrJWw_s,172
15
- Dshell/_DshellTokenizer/dshell_keywords.py,sha256=YhHUL5eILrBwk14xyb0sZ-jMsCV2jSxTW87yRZUulNQ,4808
15
+ Dshell/_DshellTokenizer/dshell_keywords.py,sha256=gN5djm3OcIxc6Rx38BQb8ILkoAbojOSUfIrJtBGST9w,4891
16
16
  Dshell/_DshellTokenizer/dshell_token_type.py,sha256=pWzvmj6EFGkDwNHooOAjdyysi1vZRVEostFIZSW1Ais,1483
17
17
  Dshell/_DshellTokenizer/dshell_tokenizer.py,sha256=-EhwrfbcOcnAxOHWBE89531t25u6c6HmJuT1AKFn9Ew,7032
18
- dshellinterpreter-0.2.5.3.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
19
- dshellinterpreter-0.2.5.3.dist-info/METADATA,sha256=XCpYMVQIdaomjeqpULm_45uq81IMEO01hCSVZxSKHv4,1122
20
- dshellinterpreter-0.2.5.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
- dshellinterpreter-0.2.5.3.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
22
- dshellinterpreter-0.2.5.3.dist-info/RECORD,,
18
+ dshellinterpreter-0.2.6.dist-info/licenses/LICENSE,sha256=lNgcw1_xb7QENAQi3uHGymaFtbs0RV-ihiCd7AoLQjA,1082
19
+ dshellinterpreter-0.2.6.dist-info/METADATA,sha256=Jz3dKMPUOvctCRFSCWcsu2M5JQYxcqIi2cf0BWy3u9s,1120
20
+ dshellinterpreter-0.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
21
+ dshellinterpreter-0.2.6.dist-info/top_level.txt,sha256=B4CMhtmchGwPQJLuqUy0GhRG-0cUGxKL4GqEbCiB_vE,7
22
+ dshellinterpreter-0.2.6.dist-info/RECORD,,