Spaces:
Paused
Paused
minutes=1, words=5
Browse files
app.py
CHANGED
|
@@ -124,7 +124,7 @@ async def on_message(message):
|
|
| 124 |
await bot.process_commands(message)
|
| 125 |
|
| 126 |
|
| 127 |
-
def extract_adjacent_words(content, trigger, num_words=
|
| 128 |
words = content.split()
|
| 129 |
pattern = r'\b' + r'\b\s*\b'.join(map(re.escape, trigger)) + r'\b'
|
| 130 |
regex = re.compile(pattern, re.IGNORECASE)
|
|
@@ -244,7 +244,7 @@ def unreact_to_slack_message(thread_ts, emoji):
|
|
| 244 |
def send_daily_pings():
|
| 245 |
global daily_pings
|
| 246 |
if daily_pings:
|
| 247 |
-
print("sending daily pings...")
|
| 248 |
# combine into one message
|
| 249 |
main_message = slack_client.chat_postMessage(
|
| 250 |
channel=SLACK_CHANNEL_ID_TEST,
|
|
@@ -267,7 +267,7 @@ def send_daily_pings():
|
|
| 267 |
# pings -------------------------------------------------------------------------------------------
|
| 268 |
executor = ThreadPoolExecutor(max_workers=1)
|
| 269 |
scheduler = BackgroundScheduler(executors={'default': executor})
|
| 270 |
-
scheduler.add_job(send_daily_pings, trigger='interval',
|
| 271 |
scheduler.start()
|
| 272 |
|
| 273 |
|
|
|
|
| 124 |
await bot.process_commands(message)
|
| 125 |
|
| 126 |
|
| 127 |
+
def extract_adjacent_words(content, trigger, num_words=5):
|
| 128 |
words = content.split()
|
| 129 |
pattern = r'\b' + r'\b\s*\b'.join(map(re.escape, trigger)) + r'\b'
|
| 130 |
regex = re.compile(pattern, re.IGNORECASE)
|
|
|
|
| 244 |
def send_daily_pings():
|
| 245 |
global daily_pings
|
| 246 |
if daily_pings:
|
| 247 |
+
print(f"sending daily pings...{daily_pings")
|
| 248 |
# combine into one message
|
| 249 |
main_message = slack_client.chat_postMessage(
|
| 250 |
channel=SLACK_CHANNEL_ID_TEST,
|
|
|
|
| 267 |
# pings -------------------------------------------------------------------------------------------
|
| 268 |
executor = ThreadPoolExecutor(max_workers=1)
|
| 269 |
scheduler = BackgroundScheduler(executors={'default': executor})
|
| 270 |
+
scheduler.add_job(send_daily_pings, trigger='interval', minutes=1)
|
| 271 |
scheduler.start()
|
| 272 |
|
| 273 |
|