Compare commits

..

No commits in common. "7c6b66660e54d4acfe9fe3c93094ebf5eb8a1086" and "9ddba0d9b1887485b4efc5abd35a0ee18e62a1c3" have entirely different histories.

2 changed files with 19 additions and 23 deletions

View File

@ -8,7 +8,7 @@ from interactions.api.events import Startup
from token_bot.token_database import database as pdb from token_bot.token_database import database as pdb
from token_bot.token_database import database as tdb from token_bot.token_database import database as tdb
VERSION = "0.9.2" VERSION = "0.9.1"
class Core(Extension): class Core(Extension):

View File

@ -77,29 +77,25 @@ class Tracker(Extension):
users_alerts[user] = [alert] users_alerts[user] = [alert]
else: else:
users_alerts[user].append(alert) users_alerts[user].append(alert)
if users_alerts: for user in users_alerts:
self.bot.logger.log(logging.INFO, "TokenBot Tracker: Processing User Alerts") discord_user = await self.bot.fetch_user(user.user_id)
for user in users_alerts: embeds = [
discord_user = await self.bot.fetch_user(user.user_id) Embed(
embeds = [ title="GoblinBot Tracker Alert Triggered",
Embed( color=0xB10000,
title="GoblinBot Tracker Alert Triggered", description=f"Hello, you requested to be sent an alert when the price of the World of Warcraft "
color=0xB10000, f"token reaches a certain value.\n\n"
description=f"Hello, you requested to be sent an alert when the price of the World of Warcraft " f"As a reminder, you can remove an alert via ```/remove-alert```\n"
f"token reaches a certain value.\n\n" f"or you can remove all alerts and user data via ```/remove-registration```\n\n",
f"As a reminder, you can remove an alert via ```/remove-alert```\n" )
f"or you can remove all alerts and user data via ```/remove-registration```\n\n", ]
) alerts_by_flavor = await gather_alerts_by_flavor(users_alerts[user])
] for flavor in alerts_by_flavor:
alerts_by_flavor = await gather_alerts_by_flavor(users_alerts[user]) embeds.append(
for flavor in alerts_by_flavor: await self._render_alert_flavor(alerts_by_flavor[flavor], user=user)
embeds.append( )
await self._render_alert_flavor(alerts_by_flavor[flavor], user=user)
)
await discord_user.send(embeds=embeds)
self.bot.logger.log(logging.INFO, "TokenBot Tracker: Done Processing User Alerts")
await discord_user.send(embeds=embeds)
################################### ###################################
# Slash Commands # # Slash Commands #