webex-bot 0.5.0__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.0 → webex_bot-0.5.2}/PKG-INFO +49 -7
  2. {webex_bot-0.5.0 → webex_bot-0.5.2}/README.md +47 -6
  3. {webex_bot-0.5.0 → webex_bot-0.5.2}/setup.cfg +1 -1
  4. {webex_bot-0.5.0 → webex_bot-0.5.2}/setup.py +6 -1
  5. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/__init__.py +1 -1
  6. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/models/command.py +5 -2
  7. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/webex_bot.py +20 -7
  8. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/websockets/webex_websocket_client.py +32 -5
  9. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot.egg-info/PKG-INFO +49 -7
  10. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot.egg-info/requires.txt +3 -0
  11. {webex_bot-0.5.0 → webex_bot-0.5.2}/CONTRIBUTING.rst +0 -0
  12. {webex_bot-0.5.0 → webex_bot-0.5.2}/LICENSE +0 -0
  13. {webex_bot-0.5.0 → webex_bot-0.5.2}/MANIFEST.in +0 -0
  14. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/Makefile +0 -0
  15. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/conf.py +0 -0
  16. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/contributing.rst +0 -0
  17. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/index.rst +0 -0
  18. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/installation.rst +0 -0
  19. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/make.bat +0 -0
  20. {webex_bot-0.5.0 → webex_bot-0.5.2}/docs/usage.rst +0 -0
  21. {webex_bot-0.5.0 → webex_bot-0.5.2}/tests/__init__.py +0 -0
  22. {webex_bot-0.5.0 → webex_bot-0.5.2}/tests/test_webex_bot.py +0 -0
  23. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/cards/__init__.py +0 -0
  24. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/commands/__init__.py +0 -0
  25. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/commands/echo.py +0 -0
  26. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/commands/help.py +0 -0
  27. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/exceptions.py +0 -0
  28. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/formatting.py +0 -0
  29. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/models/__init__.py +0 -0
  30. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/models/response.py +0 -0
  31. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot/websockets/__init__.py +0 -0
  32. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot.egg-info/SOURCES.txt +0 -0
  33. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot.egg-info/dependency_links.txt +0 -0
  34. {webex_bot-0.5.0 → webex_bot-0.5.2}/webex_bot.egg-info/not-zip-safe +0 -0
  35. {webex_bot-0.5.0 → 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.0
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
@@ -16,12 +16,21 @@ Classifier: Programming Language :: Python :: 3.8
16
16
  Classifier: Programming Language :: Python :: 3.9
17
17
  Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
+ Provides-Extra: proxy
19
20
  License-File: LICENSE
20
21
 
21
22
  # Introduction
22
23
 
23
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)
24
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
+
25
34
  By using this module, you can create a [Webex Teams][5] messaging bot quickly in just a couple of lines of code.
26
35
 
27
36
  This module does not require you to set up an ngrok tunnel to receive incoming messages when behind a firewall or
@@ -53,6 +62,10 @@ You can find a sample project, using OpenAI/ChatGPT with this library here: http
53
62
 
54
63
  `pip install webex_bot`
55
64
 
65
+ If you need optional proxy support, use this command instead:
66
+
67
+ `pip install webex_bot[proxy]`
68
+
56
69
  2. On the Webex Developer portal, create a new [bot token][3] and expose it as an environment variable.
57
70
 
58
71
  ```sh
@@ -71,11 +84,19 @@ import os
71
84
  from webex_bot.commands.echo import EchoCommand
72
85
  from webex_bot.webex_bot import WebexBot
73
86
 
87
+ # (Optional) Proxy configuration
88
+ # Supports https or wss proxy, wss prioritized.
89
+ proxies = {
90
+ 'https': 'http://proxy.esl.example.com:80',
91
+ 'wss': 'socks5://proxy.esl.example.com:1080'
92
+ }
93
+
74
94
  # Create a Bot Object
75
95
  bot = WebexBot(teams_bot_token=os.getenv("WEBEX_TEAMS_ACCESS_TOKEN"),
76
96
  approved_rooms=['06586d8d-6aad-4201-9a69-0bf9eeb5766e'],
77
97
  bot_name="My Teams Ops Bot",
78
- include_demo_commands=True)
98
+ include_demo_commands=True,
99
+ proxies=proxies)
79
100
 
80
101
  # Add new commands for the bot to listen out for.
81
102
  bot.add_command(EchoCommand())
@@ -353,13 +374,20 @@ and off you go!
353
374
 
354
375
  ### 0.5.0 (2024-Apr-25)
355
376
 
356
- * Add max backoff time (#55)
357
- * Attached files. Help, threading and log level overrides. (#54)
358
- * add stop() call to gracefully exit the bot (#42)
359
- * feat(20231212): add help image size parameter (#46)
360
- * update websockets to 11.0.3 (#43)
377
+ * Add max backoff time ([#55][pr55])
378
+ * Attached files. Help, threading and log level overrides. ([#54][pr54])
379
+ * add stop() call to gracefully exit the bot ([#42][pr42])
380
+ * feat(20231212): add help image size parameter ([#46][pr46])
381
+ * update websockets to 11.0.3 ([#43][pr43])
361
382
  * Fix for help_command syntax issue
362
383
 
384
+ ### 0.5.1 (2024-Apr-25)
385
+
386
+ * Add Proxy Support. ([#56][pr56])
387
+
388
+ ### 0.5.2 (2024-Aug-21)
389
+
390
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
363
391
 
364
392
  [1]: https://github.com/aaugustin/websockets
365
393
 
@@ -375,6 +403,20 @@ and off you go!
375
403
 
376
404
  [7]: https://eurl.io/#TeBLqZjLs
377
405
 
406
+ [pr43]: https://github.com/fbradyirl/webex_bot/pull/43
407
+
408
+ [pr46]: https://github.com/fbradyirl/webex_bot/pull/46
409
+
410
+ [pr42]: https://github.com/fbradyirl/webex_bot/pull/42
411
+
412
+ [pr54]: https://github.com/fbradyirl/webex_bot/pull/54
413
+
414
+ [pr55]: https://github.com/fbradyirl/webex_bot/pull/55
415
+
416
+ [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
417
+
418
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
419
+
378
420
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
379
421
 
380
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
@@ -33,6 +41,10 @@ You can find a sample project, using OpenAI/ChatGPT with this library here: http
33
41
 
34
42
  `pip install webex_bot`
35
43
 
44
+ If you need optional proxy support, use this command instead:
45
+
46
+ `pip install webex_bot[proxy]`
47
+
36
48
  2. On the Webex Developer portal, create a new [bot token][3] and expose it as an environment variable.
37
49
 
38
50
  ```sh
@@ -51,11 +63,19 @@ import os
51
63
  from webex_bot.commands.echo import EchoCommand
52
64
  from webex_bot.webex_bot import WebexBot
53
65
 
66
+ # (Optional) Proxy configuration
67
+ # Supports https or wss proxy, wss prioritized.
68
+ proxies = {
69
+ 'https': 'http://proxy.esl.example.com:80',
70
+ 'wss': 'socks5://proxy.esl.example.com:1080'
71
+ }
72
+
54
73
  # Create a Bot Object
55
74
  bot = WebexBot(teams_bot_token=os.getenv("WEBEX_TEAMS_ACCESS_TOKEN"),
56
75
  approved_rooms=['06586d8d-6aad-4201-9a69-0bf9eeb5766e'],
57
76
  bot_name="My Teams Ops Bot",
58
- include_demo_commands=True)
77
+ include_demo_commands=True,
78
+ proxies=proxies)
59
79
 
60
80
  # Add new commands for the bot to listen out for.
61
81
  bot.add_command(EchoCommand())
@@ -333,13 +353,20 @@ and off you go!
333
353
 
334
354
  ### 0.5.0 (2024-Apr-25)
335
355
 
336
- * Add max backoff time (#55)
337
- * Attached files. Help, threading and log level overrides. (#54)
338
- * add stop() call to gracefully exit the bot (#42)
339
- * feat(20231212): add help image size parameter (#46)
340
- * update websockets to 11.0.3 (#43)
356
+ * Add max backoff time ([#55][pr55])
357
+ * Attached files. Help, threading and log level overrides. ([#54][pr54])
358
+ * add stop() call to gracefully exit the bot ([#42][pr42])
359
+ * feat(20231212): add help image size parameter ([#46][pr46])
360
+ * update websockets to 11.0.3 ([#43][pr43])
341
361
  * Fix for help_command syntax issue
342
362
 
363
+ ### 0.5.1 (2024-Apr-25)
364
+
365
+ * Add Proxy Support. ([#56][pr56])
366
+
367
+ ### 0.5.2 (2024-Aug-21)
368
+
369
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
343
370
 
344
371
  [1]: https://github.com/aaugustin/websockets
345
372
 
@@ -355,6 +382,20 @@ and off you go!
355
382
 
356
383
  [7]: https://eurl.io/#TeBLqZjLs
357
384
 
385
+ [pr43]: https://github.com/fbradyirl/webex_bot/pull/43
386
+
387
+ [pr46]: https://github.com/fbradyirl/webex_bot/pull/46
388
+
389
+ [pr42]: https://github.com/fbradyirl/webex_bot/pull/42
390
+
391
+ [pr54]: https://github.com/fbradyirl/webex_bot/pull/54
392
+
393
+ [pr55]: https://github.com/fbradyirl/webex_bot/pull/55
394
+
395
+ [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
396
+
397
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
398
+
358
399
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
359
400
 
360
401
  [i2]: https://github.com/fbradyirl/webex_bot/issues/2
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.5.0
2
+ current_version = 0.5.2
3
3
  commit = True
4
4
  tag = True
5
5
 
@@ -13,6 +13,10 @@ setup_requirements = ['pytest-runner', ]
13
13
 
14
14
  test_requirements = ['pytest>=3', ]
15
15
 
16
+ extras_requirements = {
17
+ "proxy": ["websockets_proxy>=0.1.1"]
18
+ }
19
+
16
20
  setup(
17
21
  author="Finbarr Brady",
18
22
  author_email='finbarr@somemail.com',
@@ -26,6 +30,7 @@ setup(
26
30
  'Programming Language :: Python :: 3.9',
27
31
  ],
28
32
  description="Python package for a Webex Bot based on websockets.",
33
+ extras_require=extras_requirements,
29
34
  install_requires=requirements,
30
35
  license="MIT license",
31
36
  long_description=readme,
@@ -38,6 +43,6 @@ setup(
38
43
  test_suite='tests',
39
44
  tests_require=test_requirements,
40
45
  url='https://github.com/fbradyirl/webex_bot',
41
- version='0.5.0',
46
+ version='0.5.2',
42
47
  zip_safe=False,
43
48
  )
@@ -1,4 +1,4 @@
1
1
  """Top-level package for Webex Bot."""
2
2
 
3
3
  __author__ = """Finbarr Brady"""
4
- __version__ = '0.5.0'
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
@@ -31,7 +31,8 @@ class WebexBot(WebexWebsocketClient):
31
31
  bot_help_subtitle="Here are my available commands. Click one to begin.",
32
32
  threads=True,
33
33
  help_command=None,
34
- log_level="INFO"):
34
+ log_level="INFO",
35
+ proxies=None):
35
36
  """
36
37
  Initialise WebexBot.
37
38
 
@@ -46,7 +47,7 @@ class WebexBot(WebexWebsocketClient):
46
47
  @param threads: If True, respond to msg by creating a thread.
47
48
  @param help_command: If None, use internal HelpCommand, otherwise override.
48
49
  @param log_level: Set loggin level.
49
-
50
+ @param proxies: Dictionary of proxies for connections.
50
51
  """
51
52
 
52
53
  coloredlogs.install(level=os.getenv("LOG_LEVEL", log_level),
@@ -58,7 +59,8 @@ class WebexBot(WebexWebsocketClient):
58
59
  teams_bot_token,
59
60
  on_message=self.process_incoming_message,
60
61
  on_card_action=self.process_incoming_card_action,
61
- device_url=device_url)
62
+ device_url=device_url,
63
+ proxies=proxies)
62
64
 
63
65
  if help_command is None:
64
66
  self.help_command = HelpCommand(
@@ -232,10 +234,21 @@ class WebexBot(WebexWebsocketClient):
232
234
 
233
235
  if not is_card_callback_command and c.command_keyword:
234
236
  log.debug(f"c.command_keyword: {c.command_keyword}")
235
- if user_command.find(c.command_keyword) != -1:
236
- command = c
237
- # If a command was found, stop looking for others
238
- 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
239
252
  else:
240
253
  log.debug(f"card_callback_keyword: {c.card_callback_keyword}")
241
254
  if user_command == c.command_keyword or user_command == c.card_callback_keyword:
@@ -11,6 +11,12 @@ import requests
11
11
  import websockets
12
12
  from webexteamssdk import WebexTeamsAPI
13
13
 
14
+ try:
15
+ from websockets_proxy import Proxy, proxy_connect
16
+ except ImportError:
17
+ Proxy = None
18
+ proxy_connect = None
19
+
14
20
  logger = logging.getLogger(__name__)
15
21
 
16
22
  DEFAULT_DEVICE_URL = "https://wdm-a.wbx2.com/wdm/api/v1"
@@ -36,16 +42,23 @@ class WebexWebsocketClient(object):
36
42
  access_token,
37
43
  device_url=DEFAULT_DEVICE_URL,
38
44
  on_message=None,
39
- on_card_action=None):
45
+ on_card_action=None,
46
+ proxies=None):
40
47
  self.access_token = access_token
41
- self.teams = WebexTeamsAPI(access_token=access_token)
48
+ self.teams = WebexTeamsAPI(access_token=access_token, proxies=proxies)
42
49
  self.device_url = device_url
43
50
  self.device_info = None
44
51
  self.on_message = on_message
45
52
  self.on_card_action = on_card_action
53
+ self.proxies = proxies
46
54
  self.websocket = None
47
55
  self.share_id = None
48
56
 
57
+ if self.proxies:
58
+ # Connecting through a proxy
59
+ if proxy_connect is None:
60
+ raise ImportError("Failed to load libraries for proxy, maybe forgot [proxy] option during installation.")
61
+
49
62
  def _process_incoming_websocket_message(self, msg):
50
63
  """
51
64
  Handle websocket data.
@@ -124,7 +137,8 @@ class WebexWebsocketClient(object):
124
137
  f"{verb}/{activity_id}")
125
138
  headers = {"Authorization": f"Bearer {self.access_token}"}
126
139
  conversation_message = requests.get(conversation_message_url,
127
- headers=headers).json()
140
+ headers=headers,
141
+ proxies=self.proxies).json()
128
142
  logger.debug(f"conversation_message={conversation_message}")
129
143
  return conversation_message['id']
130
144
 
@@ -197,7 +211,20 @@ class WebexWebsocketClient(object):
197
211
  async def _connect_and_listen():
198
212
  ws_url = self.device_info['webSocketUrl']
199
213
  logger.info(f"Opening websocket connection to {ws_url}")
200
- async with websockets.connect(ws_url, ssl=ssl_context) as _websocket:
214
+
215
+ if self.proxies and "wss" in self.proxies:
216
+ logger.info(f"Using proxy for websocket connection: {self.proxies['wss']}")
217
+ proxy = Proxy.from_url(self.proxies["wss"])
218
+ connect = proxy_connect(ws_url, ssl=ssl_context, proxy=proxy)
219
+ elif self.proxies and "https" in self.proxies:
220
+ logger.info(f"Using proxy for websocket connection: {self.proxies['https']}")
221
+ proxy = Proxy.from_url(self.proxies["https"])
222
+ connect = proxy_connect(ws_url, ssl=ssl_context, proxy=proxy)
223
+ else:
224
+ logger.debug(f"Not using proxy for websocket connection.")
225
+ connect = websockets.connect(ws_url, ssl=ssl_context)
226
+
227
+ async with connect as _websocket:
201
228
  self.websocket = _websocket
202
229
  logger.info("WebSocket Opened.")
203
230
  msg = {'id': str(uuid.uuid4()),
@@ -216,4 +243,4 @@ class WebexWebsocketClient(object):
216
243
  logger.error('could not create device info')
217
244
  raise Exception("No WDM device info")
218
245
  # trigger re-connect
219
- asyncio.get_event_loop().run_until_complete(_connect_and_listen())
246
+ asyncio.get_event_loop().run_until_complete(_connect_and_listen())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: webex-bot
3
- Version: 0.5.0
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
@@ -16,12 +16,21 @@ Classifier: Programming Language :: Python :: 3.8
16
16
  Classifier: Programming Language :: Python :: 3.9
17
17
  Requires-Python: >=3.8
18
18
  Description-Content-Type: text/markdown
19
+ Provides-Extra: proxy
19
20
  License-File: LICENSE
20
21
 
21
22
  # Introduction
22
23
 
23
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)
24
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
+
25
34
  By using this module, you can create a [Webex Teams][5] messaging bot quickly in just a couple of lines of code.
26
35
 
27
36
  This module does not require you to set up an ngrok tunnel to receive incoming messages when behind a firewall or
@@ -53,6 +62,10 @@ You can find a sample project, using OpenAI/ChatGPT with this library here: http
53
62
 
54
63
  `pip install webex_bot`
55
64
 
65
+ If you need optional proxy support, use this command instead:
66
+
67
+ `pip install webex_bot[proxy]`
68
+
56
69
  2. On the Webex Developer portal, create a new [bot token][3] and expose it as an environment variable.
57
70
 
58
71
  ```sh
@@ -71,11 +84,19 @@ import os
71
84
  from webex_bot.commands.echo import EchoCommand
72
85
  from webex_bot.webex_bot import WebexBot
73
86
 
87
+ # (Optional) Proxy configuration
88
+ # Supports https or wss proxy, wss prioritized.
89
+ proxies = {
90
+ 'https': 'http://proxy.esl.example.com:80',
91
+ 'wss': 'socks5://proxy.esl.example.com:1080'
92
+ }
93
+
74
94
  # Create a Bot Object
75
95
  bot = WebexBot(teams_bot_token=os.getenv("WEBEX_TEAMS_ACCESS_TOKEN"),
76
96
  approved_rooms=['06586d8d-6aad-4201-9a69-0bf9eeb5766e'],
77
97
  bot_name="My Teams Ops Bot",
78
- include_demo_commands=True)
98
+ include_demo_commands=True,
99
+ proxies=proxies)
79
100
 
80
101
  # Add new commands for the bot to listen out for.
81
102
  bot.add_command(EchoCommand())
@@ -353,13 +374,20 @@ and off you go!
353
374
 
354
375
  ### 0.5.0 (2024-Apr-25)
355
376
 
356
- * Add max backoff time (#55)
357
- * Attached files. Help, threading and log level overrides. (#54)
358
- * add stop() call to gracefully exit the bot (#42)
359
- * feat(20231212): add help image size parameter (#46)
360
- * update websockets to 11.0.3 (#43)
377
+ * Add max backoff time ([#55][pr55])
378
+ * Attached files. Help, threading and log level overrides. ([#54][pr54])
379
+ * add stop() call to gracefully exit the bot ([#42][pr42])
380
+ * feat(20231212): add help image size parameter ([#46][pr46])
381
+ * update websockets to 11.0.3 ([#43][pr43])
361
382
  * Fix for help_command syntax issue
362
383
 
384
+ ### 0.5.1 (2024-Apr-25)
385
+
386
+ * Add Proxy Support. ([#56][pr56])
387
+
388
+ ### 0.5.2 (2024-Aug-21)
389
+
390
+ * Introduce exact_command_keyword_match feature ([#59][pr59])
363
391
 
364
392
  [1]: https://github.com/aaugustin/websockets
365
393
 
@@ -375,6 +403,20 @@ and off you go!
375
403
 
376
404
  [7]: https://eurl.io/#TeBLqZjLs
377
405
 
406
+ [pr43]: https://github.com/fbradyirl/webex_bot/pull/43
407
+
408
+ [pr46]: https://github.com/fbradyirl/webex_bot/pull/46
409
+
410
+ [pr42]: https://github.com/fbradyirl/webex_bot/pull/42
411
+
412
+ [pr54]: https://github.com/fbradyirl/webex_bot/pull/54
413
+
414
+ [pr55]: https://github.com/fbradyirl/webex_bot/pull/55
415
+
416
+ [pr56]: https://github.com/fbradyirl/webex_bot/pull/56
417
+
418
+ [pr59]: https://github.com/fbradyirl/webex_bot/pull/59
419
+
378
420
  [i1]: https://github.com/fbradyirl/webex_bot/issues/1
379
421
 
380
422
  [i2]: https://github.com/fbradyirl/webex_bot/issues/2
@@ -2,3 +2,6 @@ webexteamssdk==1.6.1
2
2
  coloredlogs
3
3
  websockets==11.0.3
4
4
  backoff
5
+
6
+ [proxy]
7
+ websockets_proxy>=0.1.1
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