Rm unused slack callback, refactor spam() to slack_post()
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Follow-up to d554fae7cd
This commit is contained in:
2024-07-28 20:09:39 +03:00
parent 13ced6105d
commit f817fde37e
5 changed files with 16 additions and 14 deletions

View File

@@ -93,16 +93,17 @@ def flatten(d, parent_key='', sep='.'):
items.append((new_key, v))
return dict(items)
def spam(msg, channel="doorboy"):
def slack_post(msg, channel):
if devenv:
print(f"{channel}: {msg}")
else:
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 })
return
channels = {
"doorboy": const.SLACK_DOORLOG_CALLBACK,
}
url = channels.get(channel, const.SLACK_DOORLOG_CALLBACK)
requests.post(url, json={"text": msg })
def build_query(base_query, fields=[], sort_fields={}):
selectors = []