|
|
@@ -3,7 +3,8 @@ from datetime import datetime
|
|
|
import requests
|
|
|
|
|
|
|
|
|
-def create_message(name, timestamp, price, quantity, current_quantity=0, forecast_previous="", forecast_latest=""):
|
|
|
+def create_message(name, timestamp, price, quantity, current_quantity=0, forecast_previous="",
|
|
|
+ forecast_latest="", npc_drop=False):
|
|
|
"""
|
|
|
Creates the string to be broadcast
|
|
|
:param name:
|
|
|
@@ -13,12 +14,16 @@ def create_message(name, timestamp, price, quantity, current_quantity=0, forecas
|
|
|
:param current_quantity:
|
|
|
:param forecast_previous:
|
|
|
:param forecast_latest:
|
|
|
+ :param npc_drop:
|
|
|
:return:
|
|
|
"""
|
|
|
this_time = datetime.utcfromtimestamp(timestamp).strftime('%Y-%m-%d %H:%M')
|
|
|
this_drop_decimal = quantity * price / 1e9
|
|
|
- this_message = "{}: {} dropped {:,} shares at ${:,.2f} for a grand total of ${:,.1f}B".format(
|
|
|
- this_time, name, quantity, price, this_drop_decimal)
|
|
|
+ npc = ''
|
|
|
+ if npc_drop:
|
|
|
+ npc = '*NPC* '
|
|
|
+ this_message = "{}: {}{} dropped {:,} shares at ${:,.2f} for a grand total of ${:,.1f}B".format(
|
|
|
+ this_time, npc, name, quantity, price, this_drop_decimal)
|
|
|
if forecast_previous and forecast_latest:
|
|
|
this_message = "{}: {} changed from {} to {} with {:,} shares available at ${:,.2f}".format(
|
|
|
this_time, name, forecast_previous, forecast_latest, current_quantity, price)
|