Bug fixes

Based on the first day of dogfooding for myself
This commit is contained in:
2024-11-30 23:42:35 -08:00
parent 5db4e76de8
commit a067953467
7 changed files with 36 additions and 39 deletions

View File

@@ -61,13 +61,14 @@ class Tracker(Extension):
else:
users_alerts[user].append(alert)
for user in users_alerts:
discord_user = self.bot.get_user(user.user_id)
discord_user = await self.bot.fetch_user(user.user_id)
alert_message = str()
for alert in users_alerts[user]:
alert_message += f"{alert.to_human_string()}"
await discord_user.send(f"Hello, you requested to be sent an alert when the price of the World of Warcraft"
if alert.alert_type != AlertType.SPECIFIC_PRICE:
alert_message += f"{alert.to_human_string()}"
await discord_user.send(f"Hello, you requested to be sent an alert when the price of the World of Warcraft "
f"token reaches a certain value.\n\n"
f"As a reminder, you can always remove an alert via /remove-alert\n"
f"As a reminder, you can remove an alert via /remove-alert\n"
f"or you can remove all registrations via /remove-registration\n\n"
f"The following alerts have been triggered: {alert_message}")
@@ -96,7 +97,8 @@ class Tracker(Extension):
text = ("## Select a region to register with \n\n"
"Please note: \n"
"* You can only be registered with one region at a time \n"
"* Changing your region will remove all previous alerts you have signed up for")
"* Changing your region will remove all previous alerts you have signed up for \n"
"* You can remove all alerts and registration using /remove-registration")
await self._users.add(ctx.user.id)
await ctx.send(text, components=REGION_MENU, ephemeral=True)
@@ -105,11 +107,6 @@ class Tracker(Extension):
await self._users.delete(ctx.user.id)
await ctx.send("All alert subscriptions and user registration deleted", ephemeral=True)
@slash_command()
async def delete(self, ctx: SlashContext):
await self._users.delete(ctx.user.id)
await ctx.send("Deletion Successful", ephemeral=True)
@slash_command()
async def exists(self, ctx: SlashContext):
await ctx.send(str(await self._users.exists(ctx.user.id)), ephemeral=True)
@@ -150,7 +147,7 @@ class Tracker(Extension):
@slash_command()
async def remove_alert(self, ctx: SlashContext):
pass
await ctx.send("This is not implemented yet, use /remove-registration for the time being", ephemeral=True)
@slash_command()
async def list_alerts(self, ctx: SlashContext):