BlueDice commited on
Commit
a824102
·
1 Parent(s): cdd5bbc

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +3 -1
handler.py CHANGED
@@ -33,7 +33,9 @@ class EndpointHandler():
33
 
34
  def response(self, result, user_name):
35
  result = result.rsplit("Alice Gate:", 1)[1].split(f"{user_name}:",1)[0].strip()
36
- result = result[:[m.start() for m in re.finditer(r'[.!?]', result)][-1]+1]
 
 
37
  return {
38
  "message": result
39
  }
 
33
 
34
  def response(self, result, user_name):
35
  result = result.rsplit("Alice Gate:", 1)[1].split(f"{user_name}:",1)[0].strip()
36
+ try:
37
+ result = result[:[m.start() for m in re.finditer(r'[.!?]', result)][-1]+1]
38
+ except Exception: pass
39
  return {
40
  "message": result
41
  }