webex-bot 1.0.1__tar.gz → 1.0.3__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-1.0.1/webex_bot.egg-info → webex_bot-1.0.3}/PKG-INFO +3 -2
  2. {webex_bot-1.0.1 → webex_bot-1.0.3}/README.md +2 -1
  3. {webex_bot-1.0.1 → webex_bot-1.0.3}/setup.cfg +1 -1
  4. {webex_bot-1.0.1 → webex_bot-1.0.3}/setup.py +1 -1
  5. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/__init__.py +1 -1
  6. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/webex_bot.py +9 -8
  7. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/websockets/webex_websocket_client.py +5 -2
  8. {webex_bot-1.0.1 → webex_bot-1.0.3/webex_bot.egg-info}/PKG-INFO +3 -2
  9. {webex_bot-1.0.1 → webex_bot-1.0.3}/CONTRIBUTING.rst +0 -0
  10. {webex_bot-1.0.1 → webex_bot-1.0.3}/LICENSE +0 -0
  11. {webex_bot-1.0.1 → webex_bot-1.0.3}/MANIFEST.in +0 -0
  12. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/Makefile +0 -0
  13. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/conf.py +0 -0
  14. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/contributing.rst +0 -0
  15. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/index.rst +0 -0
  16. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/installation.rst +0 -0
  17. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/make.bat +0 -0
  18. {webex_bot-1.0.1 → webex_bot-1.0.3}/docs/usage.rst +0 -0
  19. {webex_bot-1.0.1 → webex_bot-1.0.3}/tests/__init__.py +0 -0
  20. {webex_bot-1.0.1 → webex_bot-1.0.3}/tests/test_webex_bot.py +0 -0
  21. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/cards/__init__.py +0 -0
  22. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/commands/__init__.py +0 -0
  23. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/commands/echo.py +0 -0
  24. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/commands/help.py +0 -0
  25. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/exceptions.py +0 -0
  26. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/formatting.py +0 -0
  27. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/models/__init__.py +0 -0
  28. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/models/command.py +0 -0
  29. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/models/response.py +0 -0
  30. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot/websockets/__init__.py +0 -0
  31. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot.egg-info/SOURCES.txt +0 -0
  32. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot.egg-info/dependency_links.txt +0 -0
  33. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot.egg-info/not-zip-safe +0 -0
  34. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot.egg-info/requires.txt +0 -0
  35. {webex_bot-1.0.1 → webex_bot-1.0.3}/webex_bot.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webex_bot
3
- Version: 1.0.1
3
+ Version: 1.0.3
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
@@ -447,9 +447,10 @@ bot = WebexBot(teams_bot_token=os.getenv("WEBEX_ACCESS_TOKEN")
447
447
 
448
448
  * Fix for [issue #48][i48] - Fix for `Commands not being received` issue.
449
449
 
450
- ### 1.0.1 (2025-Jun-04)
450
+ ### 1.0.3 (2025-Jun-04)
451
451
 
452
452
  * Add connection headers to requests.
453
+ * Only call me people API once per run.
453
454
 
454
455
  [1]: https://github.com/aaugustin/websockets
455
456
 
@@ -407,9 +407,10 @@ bot = WebexBot(teams_bot_token=os.getenv("WEBEX_ACCESS_TOKEN")
407
407
 
408
408
  * Fix for [issue #48][i48] - Fix for `Commands not being received` issue.
409
409
 
410
- ### 1.0.1 (2025-Jun-04)
410
+ ### 1.0.3 (2025-Jun-04)
411
411
 
412
412
  * Add connection headers to requests.
413
+ * Only call me people API once per run.
413
414
 
414
415
  [1]: https://github.com/aaugustin/websockets
415
416
 
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.0.1
2
+ current_version = 1.0.3
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -45,6 +45,6 @@ setup(
45
45
  test_suite='tests',
46
46
  tests_require=test_requirements,
47
47
  url='https://github.com/fbradyirl/webex_bot',
48
- version='1.0.1',
48
+ version='1.0.3',
49
49
  zip_safe=False,
50
50
  )
@@ -1,4 +1,4 @@
1
1
  """Top-level package for Webex Bot."""
2
2
 
3
3
  __author__ = """Finbarr Brady"""
4
- __version__ = '1.0.1'
4
+ __version__ = '1.0.3'
@@ -23,9 +23,9 @@ class WebexBot(WebexWebsocketClient):
23
23
 
24
24
  def __init__(self,
25
25
  teams_bot_token,
26
- approved_users=[],
27
- approved_domains=[],
28
- approved_rooms=[],
26
+ approved_users=None,
27
+ approved_domains=None,
28
+ approved_rooms=None,
29
29
  include_demo_commands=False,
30
30
  bot_name="Webex Bot",
31
31
  bot_help_subtitle="Here are my available commands. Click one to begin.",
@@ -61,11 +61,12 @@ class WebexBot(WebexWebsocketClient):
61
61
  on_card_action=self.process_incoming_card_action,
62
62
  proxies=proxies)
63
63
 
64
+ me = self.get_me_info()
64
65
  if help_command is None:
65
66
  self.help_command = HelpCommand(
66
67
  bot_name=bot_name,
67
68
  bot_help_subtitle=bot_help_subtitle,
68
- bot_help_image=self.teams.people.me().avatar)
69
+ bot_help_image=me.avatar)
69
70
  else:
70
71
  self.help_command = help_command
71
72
 
@@ -83,12 +84,11 @@ class WebexBot(WebexWebsocketClient):
83
84
  self.help_command.commands = self.commands
84
85
 
85
86
  self.card_callback_commands = {}
86
- self.approved_users = approved_users
87
- self.approved_domains = approved_domains
88
- self.approved_rooms = approved_rooms
87
+ self.approved_users = approved_users if approved_users is not None else []
88
+ self.approved_domains = approved_domains if approved_domains is not None else []
89
+ self.approved_rooms = approved_rooms if approved_rooms is not None else []
89
90
  self.approval_parameters_check()
90
91
  self.bot_display_name = ""
91
- self.get_me_info()
92
92
  self.threads = threads
93
93
 
94
94
  @backoff.on_exception(backoff.expo, requests.exceptions.ConnectionError)
@@ -100,6 +100,7 @@ class WebexBot(WebexWebsocketClient):
100
100
  self.bot_display_name = me.displayName
101
101
  log.info(f"Running as {me.type} '{me.displayName}' with email {me.emails}")
102
102
  log.debug(f"Running as bot '{me}'")
103
+ return me
103
104
 
104
105
  def add_command(self, command_class: Command):
105
106
  """
@@ -51,6 +51,8 @@ class WebexWebsocketClient(object):
51
51
  self.tracking_id = f"webex-bot_{uuid.uuid4()}"
52
52
  self.session = requests.Session()
53
53
  self.session.headers = self._get_headers()
54
+ sdk_ua = self.teams._session.headers["User-Agent"]
55
+ self.teams._session.update_headers(self._get_headers(add_to_ua=f" ({sdk_ua})"))
54
56
  # log the tracking ID
55
57
  logger.info(f"Tracking ID: {self.tracking_id}")
56
58
  self.device_info = None
@@ -67,10 +69,11 @@ class WebexWebsocketClient(object):
67
69
  if proxy_connect is None:
68
70
  raise ImportError("Failed to load libraries for proxy, maybe forgot [proxy] option during installation.")
69
71
 
70
- def _get_headers(self):
72
+ def _get_headers(self, add_to_ua=''):
71
73
  return {
72
74
  "Authorization": f"Bearer {self.access_token}",
73
- "User-Agent": f"webex_bot/{__version__}",
75
+ "Content-type": "application/json;charset=utf-8",
76
+ "User-Agent": f"webex_bot/{__version__}{add_to_ua}",
74
77
  "trackingid": self.tracking_id
75
78
  }
76
79
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: webex_bot
3
- Version: 1.0.1
3
+ Version: 1.0.3
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
@@ -447,9 +447,10 @@ bot = WebexBot(teams_bot_token=os.getenv("WEBEX_ACCESS_TOKEN")
447
447
 
448
448
  * Fix for [issue #48][i48] - Fix for `Commands not being received` issue.
449
449
 
450
- ### 1.0.1 (2025-Jun-04)
450
+ ### 1.0.3 (2025-Jun-04)
451
451
 
452
452
  * Add connection headers to requests.
453
+ * Only call me people API once per run.
453
454
 
454
455
  [1]: https://github.com/aaugustin/websockets
455
456
 
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