webex-bot 1.0.5__py2.py3-none-any.whl → 1.0.7__py2.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.
- webex_bot/__init__.py +1 -1
- webex_bot/webex_bot.py +11 -4
- {webex_bot-1.0.5.dist-info → webex_bot-1.0.7.dist-info}/METADATA +4 -1
- {webex_bot-1.0.5.dist-info → webex_bot-1.0.7.dist-info}/RECORD +7 -7
- {webex_bot-1.0.5.dist-info → webex_bot-1.0.7.dist-info}/WHEEL +0 -0
- {webex_bot-1.0.5.dist-info → webex_bot-1.0.7.dist-info}/licenses/LICENSE +0 -0
- {webex_bot-1.0.5.dist-info → webex_bot-1.0.7.dist-info}/top_level.txt +0 -0
webex_bot/__init__.py
CHANGED
webex_bot/webex_bot.py
CHANGED
|
@@ -30,6 +30,7 @@ class WebexBot(WebexWebsocketClient):
|
|
|
30
30
|
bot_name="Webex Bot",
|
|
31
31
|
bot_help_subtitle="Here are my available commands. Click one to begin.",
|
|
32
32
|
threads=True,
|
|
33
|
+
allow_bot_to_bot=False,
|
|
33
34
|
help_command=None,
|
|
34
35
|
log_level="INFO",
|
|
35
36
|
proxies=None):
|
|
@@ -41,10 +42,11 @@ class WebexBot(WebexWebsocketClient):
|
|
|
41
42
|
@param approved_domains: List of domains which are allowed to chat to this bot.
|
|
42
43
|
@param approved_rooms: List of rooms whose members are allowed to chat to this bot.
|
|
43
44
|
@param device_url: WDM Url
|
|
44
|
-
@param include_demo_commands: If True, any demo commands will be included.
|
|
45
|
+
@param include_demo_commands: If True, any demo commands will be included. (default False)
|
|
45
46
|
@param bot_name: Your custom name for the bot.
|
|
46
47
|
@param bot_help_subtitle: Text to show in the help card.
|
|
47
|
-
@param threads: If True, respond to msg by creating a thread.
|
|
48
|
+
@param threads: If True, respond to msg by creating a thread. (default True)
|
|
49
|
+
@param allow_bot_to_bot: If True, incoming messages from other bots will be processed. Use with caution to avoid message loops. (default False)
|
|
48
50
|
@param help_command: If None, use internal HelpCommand, otherwise override.
|
|
49
51
|
@param log_level: Set loggin level.
|
|
50
52
|
@param proxies: Dictionary of proxies for connections.
|
|
@@ -91,6 +93,7 @@ class WebexBot(WebexWebsocketClient):
|
|
|
91
93
|
self.approval_parameters_check()
|
|
92
94
|
self.bot_display_name = ""
|
|
93
95
|
self.threads = threads
|
|
96
|
+
self.allow_bot_to_bot = allow_bot_to_bot
|
|
94
97
|
|
|
95
98
|
@backoff.on_exception(backoff.expo, requests.exceptions.ConnectionError)
|
|
96
99
|
def get_me_info(self):
|
|
@@ -204,8 +207,12 @@ class WebexBot(WebexWebsocketClient):
|
|
|
204
207
|
is_one_on_one_space = 'ONE_ON_ONE' in activity['target']['tags']
|
|
205
208
|
|
|
206
209
|
if activity['actor']['type'] != 'PERSON':
|
|
207
|
-
|
|
208
|
-
|
|
210
|
+
if not self.allow_bot_to_bot:
|
|
211
|
+
log.warning(f"Message is from a bot ({user_email}), ignoring")
|
|
212
|
+
return
|
|
213
|
+
else:
|
|
214
|
+
log.warning(
|
|
215
|
+
f"Message is from a bot ({user_email}), and allow_bot_to_bot is {self.allow_bot_to_bot}. Be careful not to create a message loop!")
|
|
209
216
|
|
|
210
217
|
# Log details on message
|
|
211
218
|
log.info(f"Message from {user_email}: {teams_message}")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: webex_bot
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
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
|
|
@@ -460,6 +460,9 @@ bot = WebexBot(teams_bot_token=os.getenv("WEBEX_ACCESS_TOKEN")
|
|
|
460
460
|
|
|
461
461
|
* Update UA
|
|
462
462
|
|
|
463
|
+
### 1.0.7 (2025-Sept-17)
|
|
464
|
+
|
|
465
|
+
* Allow flag to disable bot to bot check
|
|
463
466
|
|
|
464
467
|
[1]: https://github.com/aaugustin/websockets
|
|
465
468
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
webex_bot/__init__.py,sha256=
|
|
1
|
+
webex_bot/__init__.py,sha256=khfK-5S8GGJi-F6Y8AYhEOeZtF7W7B2IBROMjDG_t6U,95
|
|
2
2
|
webex_bot/exceptions.py,sha256=qs9yVitfJtvxwBMC8uCvTDOxUQ_oZjWFf1dU8Oaue14,740
|
|
3
3
|
webex_bot/formatting.py,sha256=jvPKym-z8CIJygpPVTVbt6vFXQo9_HQHpRDJB-nh-SI,382
|
|
4
|
-
webex_bot/webex_bot.py,sha256=
|
|
4
|
+
webex_bot/webex_bot.py,sha256=fuqucqKCZ-jFo4qW3XAYo7n5g_LB3GQnuAuQHEZRw_Y,21866
|
|
5
5
|
webex_bot/cards/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
webex_bot/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
webex_bot/commands/echo.py,sha256=STY-MikBRjUteDK-g8G4GPB0V-Yi7siPN1DRMXrT-QU,3399
|
|
@@ -11,8 +11,8 @@ webex_bot/models/command.py,sha256=MyThlDaEkGlj1fDE_i_wr79O3QboakimRme8yI744yo,5
|
|
|
11
11
|
webex_bot/models/response.py,sha256=d4k2ohR5SUVzvuQzcnm7jQQVTMB0gH9Kz9y09vkoAaU,2545
|
|
12
12
|
webex_bot/websockets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
webex_bot/websockets/webex_websocket_client.py,sha256=ZlyTyNZuWr7cbf0mHBPu7JB432gVwBKT2Gvq9K1Pv5k,13895
|
|
14
|
-
webex_bot-1.0.
|
|
15
|
-
webex_bot-1.0.
|
|
16
|
-
webex_bot-1.0.
|
|
17
|
-
webex_bot-1.0.
|
|
18
|
-
webex_bot-1.0.
|
|
14
|
+
webex_bot-1.0.7.dist-info/licenses/LICENSE,sha256=93eGb10xmgkBP2Fh_n0E9YDXe0c0oz-FsnAimXG0S4Y,1072
|
|
15
|
+
webex_bot-1.0.7.dist-info/METADATA,sha256=ZtQy9gjLJT6gFgrXLk94wBqn9ZGXZViQ2ATs2VX28_I,14887
|
|
16
|
+
webex_bot-1.0.7.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
|
|
17
|
+
webex_bot-1.0.7.dist-info/top_level.txt,sha256=q1Y0RtYYinR7oXSwL93cK59c2KN_CbMVca8MLWeF63M,10
|
|
18
|
+
webex_bot-1.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|