webex-bot 1.0.6__py2.py3-none-any.whl → 1.0.8__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 CHANGED
@@ -1,4 +1,4 @@
1
1
  """Top-level package for Webex Bot."""
2
2
 
3
3
  __author__ = """Finbarr Brady"""
4
- __version__ = '1.0.6'
4
+ __version__ = '1.0.8'
webex_bot/webex_bot.py CHANGED
@@ -102,7 +102,8 @@ class WebexBot(WebexWebsocketClient):
102
102
  """
103
103
  me = self.teams.people.me()
104
104
  self.bot_display_name = me.displayName
105
- log.info(f"Running as {me.type} '{me.displayName}' with email {me.emails}")
105
+ self.bot_email = me.emails[0]
106
+ log.info(f"Running as {me.type} '{me.displayName}' with email {self.bot_email}")
106
107
  log.debug(f"Running as bot '{me}'")
107
108
  return me
108
109
 
@@ -206,12 +207,16 @@ class WebexBot(WebexWebsocketClient):
206
207
  raw_message = teams_message.text
207
208
  is_one_on_one_space = 'ONE_ON_ONE' in activity['target']['tags']
208
209
 
209
- if activity['actor']['type'] != 'PERSON' and not self.allow_bot_to_bot:
210
- log.warning('Message is from a bot, ignoring')
211
- return
212
- else:
213
- log.warning(
214
- f"Message is from a bot and allow_bot_to_bot is {self.allow_bot_to_bot}. Be careful not to create a message loop!")
210
+ if activity['actor']['type'] != 'PERSON':
211
+ if self.bot_email == user_email:
212
+ log.warning(f"Message is from myself ({self.bot_email}), ignoring.")
213
+ return
214
+ if not self.allow_bot_to_bot:
215
+ log.warning(f"Message is from a bot ({user_email}), ignoring.")
216
+ return
217
+ else:
218
+ log.warning(
219
+ f"Message is from another bot ({user_email}), and allow_bot_to_bot is {self.allow_bot_to_bot}. Be careful not to create a message loop!")
215
220
 
216
221
  # Log details on message
217
222
  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.6
3
+ Version: 1.0.8
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,7 +460,7 @@ bot = WebexBot(teams_bot_token=os.getenv("WEBEX_ACCESS_TOKEN")
460
460
 
461
461
  * Update UA
462
462
 
463
- ### 1.0.6 (2025-Sept-17)
463
+ ### 1.0.8 (2025-Sept-18)
464
464
 
465
465
  * Allow flag to disable bot to bot check
466
466
 
@@ -1,7 +1,7 @@
1
- webex_bot/__init__.py,sha256=qc-1SbTkooTynnF9zQGCoDfMfosolKxMvBBa8Mw_qFk,95
1
+ webex_bot/__init__.py,sha256=qoZvkulvaJ2p1Nz8u_sfKjX7O-TAr7RW7zA3ej0n2O0,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=tlogg1mu30et-O38B8eNMbHIHhs0g2bwL6uZEOSMDeg,21802
4
+ webex_bot/webex_bot.py,sha256=eQSsUX0lYQDVjh7DXX1Or5E8I-8gIKh4vQ3FzGoXAq4,22069
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.6.dist-info/licenses/LICENSE,sha256=93eGb10xmgkBP2Fh_n0E9YDXe0c0oz-FsnAimXG0S4Y,1072
15
- webex_bot-1.0.6.dist-info/METADATA,sha256=bxwRlGcbQlHJ5nA4qAbuxJ2eyo4NY0WroHetB0rlhbg,14887
16
- webex_bot-1.0.6.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
17
- webex_bot-1.0.6.dist-info/top_level.txt,sha256=q1Y0RtYYinR7oXSwL93cK59c2KN_CbMVca8MLWeF63M,10
18
- webex_bot-1.0.6.dist-info/RECORD,,
14
+ webex_bot-1.0.8.dist-info/licenses/LICENSE,sha256=93eGb10xmgkBP2Fh_n0E9YDXe0c0oz-FsnAimXG0S4Y,1072
15
+ webex_bot-1.0.8.dist-info/METADATA,sha256=xwpWPEPi6fOBO6-64MK80YOAc-F80k2-Iq5Hkx0XzSw,14887
16
+ webex_bot-1.0.8.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
17
+ webex_bot-1.0.8.dist-info/top_level.txt,sha256=q1Y0RtYYinR7oXSwL93cK59c2KN_CbMVca8MLWeF63M,10
18
+ webex_bot-1.0.8.dist-info/RECORD,,