Compare commits
No commits in common. "5372ec1d945be8eddbf6fc86b92787dca0bc61f6" and "3303f9a939d22b7b1974bb3d0fb27551d9e72997" have entirely different histories.
5372ec1d94
...
3303f9a939
@ -1,5 +1,3 @@
|
|||||||
import logging
|
|
||||||
|
|
||||||
import aiohttp
|
import aiohttp
|
||||||
from interactions import Extension
|
from interactions import Extension
|
||||||
from interactions import slash_command, listen
|
from interactions import slash_command, listen
|
||||||
@ -18,8 +16,8 @@ class Core(Extension):
|
|||||||
|
|
||||||
@listen(Startup)
|
@listen(Startup)
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
self.bot.logger.log(logging.INFO,"TokenBot Core ready")
|
print("TokenBot Core ready")
|
||||||
self.bot.logger.log(logging.INFO,f"This is bot version {VERSION}")
|
print(f"This is bot version {VERSION}")
|
||||||
self._tdb = tdb.Database(aiohttp.ClientSession())
|
self._tdb = tdb.Database(aiohttp.ClientSession())
|
||||||
|
|
||||||
@slash_command()
|
@slash_command()
|
||||||
|
@ -21,14 +21,9 @@ class UpdateTrigger:
|
|||||||
def last_trigger(self) -> Tuple[datetime.datetime, int] | None:
|
def last_trigger(self) -> Tuple[datetime.datetime, int] | None:
|
||||||
return self._last_trigger
|
return self._last_trigger
|
||||||
|
|
||||||
@property
|
|
||||||
def last_alerting(self) -> Tuple[datetime.datetime, int] | None:
|
def last_alerting(self) -> Tuple[datetime.datetime, int] | None:
|
||||||
return self._last_alerting
|
return self._last_alerting
|
||||||
|
|
||||||
@property
|
|
||||||
def squelched(self):
|
|
||||||
return self._squelched
|
|
||||||
|
|
||||||
def _find_next_trigger(self, comparison_operator: operator, starting_point: datetime.datetime, history: List[Tuple[datetime.datetime, int]]):
|
def _find_next_trigger(self, comparison_operator: operator, starting_point: datetime.datetime, history: List[Tuple[datetime.datetime, int]]):
|
||||||
candidate_datum : Tuple[datetime.datetime, int] | None = None
|
candidate_datum : Tuple[datetime.datetime, int] | None = None
|
||||||
for datum in history:
|
for datum in history:
|
||||||
|
@ -368,20 +368,8 @@ class Tracker(Extension):
|
|||||||
history = await self._history_manager.get_history(alert.flavor, alert.region)
|
history = await self._history_manager.get_history(alert.flavor, alert.region)
|
||||||
trigger = await history.find_update_trigger_from_alert(alert)
|
trigger = await history.find_update_trigger_from_alert(alert)
|
||||||
if trigger.last_trigger is not None:
|
if trigger.last_trigger is not None:
|
||||||
alert_str = (f"Last Alerting Price Value: {format(trigger.last_alerting[1], ",")}\n"
|
alert_str = (f"Last Alerting Price Value: {format(trigger.last_alerting()[1], ",")}\n"
|
||||||
f"Last Alerting Time: {trigger.last_alerting[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n")
|
f"Last Alerting Time: {trigger.last_alerting()[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n")
|
||||||
if is_owner():
|
|
||||||
alert_str += (f"\nShowing you some internals since you are the bot owner:\n"
|
|
||||||
f"```history.last_price_datum:\n"
|
|
||||||
f"\t{history.last_price_datum[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n"
|
|
||||||
f"\t{history.last_price_datum[1]}\n"
|
|
||||||
f"trigger.last_alerting:\n"
|
|
||||||
f"\t{trigger.last_alerting[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n"
|
|
||||||
f"\t{trigger.last_alerting[1]}\n"
|
|
||||||
f"trigger.last_trigger:\n"
|
|
||||||
f"\t{trigger.last_trigger[0].strftime('%Y-%m-%d %H:%M:%S UTC')}\n"
|
|
||||||
f"\t{trigger.last_trigger[1]}\n"
|
|
||||||
f"trigger.squelched:\n\t{trigger.squelched}```")
|
|
||||||
else:
|
else:
|
||||||
alert_str = "You should only be seeing this if the bot has not finished importing history at startup."
|
alert_str = "You should only be seeing this if the bot has not finished importing history at startup."
|
||||||
fields.append(
|
fields.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user