Added <!channel|@channel>
This commit is contained in:
parent
3cf49c7634
commit
1ea873fe17
1 changed files with 5 additions and 5 deletions
|
@ -215,16 +215,16 @@ def get_orders(expression=None):
|
||||||
def post_order_to_webhook(order_item):
|
def post_order_to_webhook(order_item):
|
||||||
message = ''
|
message = ''
|
||||||
if order_item.courrier is not None:
|
if order_item.courrier is not None:
|
||||||
message = '{3} is going to {1}, order <{0}|here>! Deadline in {2} minutes!'.format(
|
message = '<!channel|@channel> {3} is going to {1}, order <{0}|here>! Deadline in {2} minutes!'.format(
|
||||||
url_for('.order', id=order_item.id, _external=True),
|
url_for('.order', id=order_item.id, _external=True),
|
||||||
order_item.location.name,
|
order_item.location.name,
|
||||||
remaining_minutes(order_item.stoptime),
|
remaining_minutes(order_item.stoptime),
|
||||||
order_item.courrier.username.title())
|
order_item.courrier.username.title())
|
||||||
else:
|
else:
|
||||||
message = '<{}|Open here.> New order for {}. Deadline in {} minutes.'.format(
|
message = '<!channel|@channel> New order for {}. Deadline in {} minutes. <{}|Open here.>'.format(
|
||||||
url_for('.order', id=order_item.id, _external=True),
|
|
||||||
order_item.location.name,
|
order_item.location.name,
|
||||||
remaining_minutes(order_item.stoptime))
|
remaining_minutes(order_item.stoptime),
|
||||||
|
url_for('.order', id=order_item.id, _external=True))
|
||||||
webhookthread = WebhookSenderThread(message)
|
webhookthread = WebhookSenderThread(message)
|
||||||
webhookthread.start()
|
webhookthread.start()
|
||||||
|
|
||||||
|
@ -252,4 +252,4 @@ def remaining_minutes(value):
|
||||||
if delta.total_seconds() < 0:
|
if delta.total_seconds() < 0:
|
||||||
return "0"
|
return "0"
|
||||||
minutes, _ = divmod(delta.total_seconds(), 60)
|
minutes, _ = divmod(delta.total_seconds(), 60)
|
||||||
return "%02d" % minutes
|
return "%02d" % minutes
|
||||||
|
|
Loading…
Reference in a new issue