-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdolphin_bot.py
31 lines (22 loc) · 1.16 KB
/
dolphin_bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import logging
import op_dolphin_bot.dolphin_bot as dolphin
from op_dolphin_bot.constants import PROGRAM_NAME, PROGRAM_VERSION
# CONFIGURATION START
# ---
# Copy and paste the URL from Slack's "Incoming WebHooks" Integration:
SLACK_INCOMING_HOOK_URL = "https://hooks.slack.com/services/..."
# Your base URL:
OP_BASE_URL = "https://YOUR.OPENPROJECT..."
# The ID of the project which activities are tracked. Use util/op_project_list.py if you aren't sure:
OP_PROJECT_ID = 2
# Your RSS API Key. See "Account Settings -> Tokens" in OpenProject.
OP_RSS_KEY = "****************************************"
# Specify elements you want to track. Recognizes everything except "cost_objects" and "time_entries" by default:
OP_RSS_FILTER = ('work_packages', 'wiki_edits', 'news', 'documents', 'meetings')
# ---
# CONFIGURATION END
logging.basicConfig(format='%(asctime)s - %(levelname)s: %(message)s', level=logging.DEBUG)
logging.info("Started %s. Current version: %s", PROGRAM_NAME, PROGRAM_VERSION)
bot = dolphin.DolphinBot(SLACK_INCOMING_HOOK_URL, OP_BASE_URL, OP_PROJECT_ID, OP_RSS_KEY, OP_RSS_FILTER,
refresh_rate=150, max_links=15, smart_summary_limit=2)
bot.run()