webex-bot 0.5.1__tar.gz → 0.5.2__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 (35) hide show
  1. {webex_bot-0.5.1 → webex_bot-0.5.2}/PKG-INFO +15 -1
  2. {webex_bot-0.5.1 → webex_bot-0.5.2}/README.md +14 -0
  3. {webex_bot-0.5.1 → webex_bot-0.5.2}/setup.cfg +1 -1
  4. {webex_bot-0.5.1 → webex_bot-0.5.2}/setup.py +1 -1
  5. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/__init__.py +1 -1
  6. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/models/command.py +5 -2
  7. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/webex_bot.py +15 -4
  8. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/PKG-INFO +15 -1
  9. {webex_bot-0.5.1 → webex_bot-0.5.2}/CONTRIBUTING.rst +0 -0
  10. {webex_bot-0.5.1 → webex_bot-0.5.2}/LICENSE +0 -0
  11. {webex_bot-0.5.1 → webex_bot-0.5.2}/MANIFEST.in +0 -0
  12. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/Makefile +0 -0
  13. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/conf.py +0 -0
  14. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/contributing.rst +0 -0
  15. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/index.rst +0 -0
  16. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/installation.rst +0 -0
  17. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/make.bat +0 -0
  18. {webex_bot-0.5.1 → webex_bot-0.5.2}/docs/usage.rst +0 -0
  19. {webex_bot-0.5.1 → webex_bot-0.5.2}/tests/__init__.py +0 -0
  20. {webex_bot-0.5.1 → webex_bot-0.5.2}/tests/test_webex_bot.py +0 -0
  21. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/cards/__init__.py +0 -0
  22. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/commands/__init__.py +0 -0
  23. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/commands/echo.py +0 -0
  24. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/commands/help.py +0 -0
  25. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/exceptions.py +0 -0
  26. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/formatting.py +0 -0
  27. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/models/__init__.py +0 -0
  28. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/models/response.py +0 -0
  29. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/websockets/__init__.py +0 -0
  30. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot/websockets/webex_websocket_client.py +0 -0
  31. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/SOURCES.txt +0 -0
  32. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/dependency_links.txt +0 -0
  33. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/not-zip-safe +0 -0
  34. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/requires.txt +0 -0
  35. {webex_bot-0.5.1 → webex_bot-0.5.2}/webex_bot.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webex_bot
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Python package for a Webex Bot based on websockets.
5
5
  Home-page: https://github.com/fbradyirl/webex_bot
6
6
  Author: Finbarr Brady
@@ -23,6 +23,14 @@ License-File: LICENSE
23
23
 
24
24
  [![Pypi](https://img.shields.io/pypi/v/webex_bot.svg)](https://pypi.python.org/pypi/webex_bot) [![Build Status](https://github.com/fbradyirl/webex_bot/workflows/Python%20package/badge.svg)](https://github.com/fbradyirl/webex_bot/actions)
25
25
 
26
+ > [!IMPORTANT]
27
+ > This repository is only sporadically maintained. Breaking API changes will be maintained on a best efforts basis.
28
+ >
29
+ > Collaborators are welcome, as are PRs for enhancements.
30
+ >
31
+ > Bug reports unrelated to API changes may not get the attention you want.
32
+
33
+
26
34
  By using this module, you can create a [Webex Teams][5] messaging bot quickly in just a couple of lines of code.
27
35
 
28
36
  This module does not require you to set up an ngrok tunnel to receive incoming messages when behind a firewall or
@@ -377,6 +385,10 @@ and off you go!
377
385
 
378
386
  * Add Proxy Support. ([#56][pr56])
379
387
 
388
+ ### 0.5.2 (2024-Aug-21)
389
+
390
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
391
+
380
392
  [1]: https://github.com/aaugustin/websockets
381
393
 
382
394
  [2]: https://github.com/CiscoDevNet/webexteamssdk
@@ -403,6 +415,8 @@ and off you go!
403
415
 
404
416
  [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
405
417
 
418
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
419
+
406
420
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
407
421
 
408
422
  [i2]: https://github.com/fbradyirl/webex_bot/issues/2
@@ -2,6 +2,14 @@
2
2
 
3
3
  [![Pypi](https://img.shields.io/pypi/v/webex_bot.svg)](https://pypi.python.org/pypi/webex_bot) [![Build Status](https://github.com/fbradyirl/webex_bot/workflows/Python%20package/badge.svg)](https://github.com/fbradyirl/webex_bot/actions)
4
4
 
5
+ > [!IMPORTANT]
6
+ > This repository is only sporadically maintained. Breaking API changes will be maintained on a best efforts basis.
7
+ >
8
+ > Collaborators are welcome, as are PRs for enhancements.
9
+ >
10
+ > Bug reports unrelated to API changes may not get the attention you want.
11
+
12
+
5
13
  By using this module, you can create a [Webex Teams][5] messaging bot quickly in just a couple of lines of code.
6
14
 
7
15
  This module does not require you to set up an ngrok tunnel to receive incoming messages when behind a firewall or
@@ -356,6 +364,10 @@ and off you go!
356
364
 
357
365
  * Add Proxy Support. ([#56][pr56])
358
366
 
367
+ ### 0.5.2 (2024-Aug-21)
368
+
369
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
370
+
359
371
  [1]: https://github.com/aaugustin/websockets
360
372
 
361
373
  [2]: https://github.com/CiscoDevNet/webexteamssdk
@@ -382,6 +394,8 @@ and off you go!
382
394
 
383
395
  [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
384
396
 
397
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
398
+
385
399
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
386
400
 
387
401
  [i2]: https://github.com/fbradyirl/webex_bot/issues/2
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.5.1
2
+ current_version = 0.5.2
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -43,6 +43,6 @@ setup(
43
43
  test_suite='tests',
44
44
  tests_require=test_requirements,
45
45
  url='https://github.com/fbradyirl/webex_bot',
46
- version='0.5.1',
46
+ version='0.5.2',
47
47
  zip_safe=False,
48
48
  )
@@ -1,4 +1,4 @@
1
1
  """Top-level package for Webex Bot."""
2
2
 
3
3
  __author__ = """Finbarr Brady"""
4
- __version__ = '0.5.1'
4
+ __version__ = '0.5.2'
@@ -9,8 +9,9 @@ COMMAND_KEYWORD_KEY = "command_keyword"
9
9
 
10
10
  class Command(ABC):
11
11
 
12
- def __init__(self, command_keyword=None, chained_commands=[], card=None, help_message=None,
13
- delete_previous_message=False,
12
+ def __init__(self, command_keyword=None, exact_command_keyword_match=False,
13
+ chained_commands=[], card=None,
14
+ help_message=None, delete_previous_message=False,
14
15
  card_callback_keyword=None, approved_rooms=None):
15
16
  """
16
17
  Create a new bot command.
@@ -25,6 +26,7 @@ class Command(ABC):
25
26
  )
26
27
 
27
28
  @param command_keyword: (optional) Text indicating a phrase to invoke this card.
29
+ @param exact_command_keyword_match: If True, there will be an exact command_keyword match performed. If False, then a sub-string match will be performed. Default: False.
28
30
  @param chained_commands: (optional) List of other commands related
29
31
  to this command. This allows multiple related cards to be added at once.
30
32
  @param card: (deprecated) A dict representation of the JSON card.
@@ -37,6 +39,7 @@ class Command(ABC):
37
39
  @param approved_rooms: If defined, only members of these spaces will be allowed to run this command. Default: None (everyone)
38
40
  """
39
41
  self.command_keyword = command_keyword
42
+ self.exact_command_keyword_match = exact_command_keyword_match
40
43
  self.help_message = help_message
41
44
  self.card = card
42
45
  self.pre_card_callback = self.execute
@@ -234,10 +234,21 @@ class WebexBot(WebexWebsocketClient):
234
234
 
235
235
  if not is_card_callback_command and c.command_keyword:
236
236
  log.debug(f"c.command_keyword: {c.command_keyword}")
237
- if user_command.find(c.command_keyword) != -1:
238
- command = c
239
- # If a command was found, stop looking for others
240
- break
237
+ log.info(f"exact_command_keyword_match: {c.exact_command_keyword_match}")
238
+ log.info(f"user_command: {user_command}")
239
+ log.info(f"command_keyword: {c.command_keyword}")
240
+ if c.exact_command_keyword_match: # Check if the "exact_command_keyword_match" flag is set to True
241
+ if user_command == c.command_keyword:
242
+ log.info("Exact match found!")
243
+ command=c
244
+ # If a command was found, stop looking for others
245
+ break
246
+ else: # Enter here if the "exact_command_keyword_match" flag is set to False
247
+ if user_command.find(c.command_keyword) != -1:
248
+ log.info("Sub-string match found!")
249
+ command = c
250
+ # If a command was found, stop looking for others
251
+ break
241
252
  else:
242
253
  log.debug(f"card_callback_keyword: {c.card_callback_keyword}")
243
254
  if user_command == c.command_keyword or user_command == c.card_callback_keyword:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webex-bot
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Python package for a Webex Bot based on websockets.
5
5
  Home-page: https://github.com/fbradyirl/webex_bot
6
6
  Author: Finbarr Brady
@@ -23,6 +23,14 @@ License-File: LICENSE
23
23
 
24
24
  [![Pypi](https://img.shields.io/pypi/v/webex_bot.svg)](https://pypi.python.org/pypi/webex_bot) [![Build Status](https://github.com/fbradyirl/webex_bot/workflows/Python%20package/badge.svg)](https://github.com/fbradyirl/webex_bot/actions)
25
25
 
26
+ > [!IMPORTANT]
27
+ > This repository is only sporadically maintained. Breaking API changes will be maintained on a best efforts basis.
28
+ >
29
+ > Collaborators are welcome, as are PRs for enhancements.
30
+ >
31
+ > Bug reports unrelated to API changes may not get the attention you want.
32
+
33
+
26
34
  By using this module, you can create a [Webex Teams][5] messaging bot quickly in just a couple of lines of code.
27
35
 
28
36
  This module does not require you to set up an ngrok tunnel to receive incoming messages when behind a firewall or
@@ -377,6 +385,10 @@ and off you go!
377
385
 
378
386
  * Add Proxy Support. ([#56][pr56])
379
387
 
388
+ ### 0.5.2 (2024-Aug-21)
389
+
390
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
391
+
380
392
  [1]: https://github.com/aaugustin/websockets
381
393
 
382
394
  [2]: https://github.com/CiscoDevNet/webexteamssdk
@@ -403,6 +415,8 @@ and off you go!
403
415
 
404
416
  [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
405
417
 
418
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
419
+
406
420
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
407
421
 
408
422
  [i2]: https://github.com/fbradyirl/webex_bot/issues/2
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes