Use separate slack channel for inventory messages
This commit is contained in:
@@ -93,11 +93,15 @@ def flatten(d, parent_key='', sep='.'):
|
||||
items.append((new_key, v))
|
||||
return dict(items)
|
||||
|
||||
def spam(msg):
|
||||
def spam(msg, channel="doorboy"):
|
||||
if devenv:
|
||||
print(msg)
|
||||
print(f"{channel}: {msg}")
|
||||
else:
|
||||
url = const.SLACK_DOORLOG_CALLBACK
|
||||
urls = {
|
||||
"doorboy": const.SLACK_DOORLOG_CALLBACK,
|
||||
"inventory": const.SLACK_INVENTORY_CALLBACK
|
||||
}
|
||||
url = urls.get(channel, const.SLACK_DOORLOG_CALLBACK)
|
||||
requests.post(url, json={"text": msg })
|
||||
|
||||
def build_query(base_query, fields=[], sort_fields={}):
|
||||
|
Reference in New Issue
Block a user