Rm unused slack callback, refactor spam() to slack_post()
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Follow-up to d554fae7cd
This commit is contained in:
@@ -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 = []
|
||||
|
Reference in New Issue
Block a user