Potential fix for "Unknown integration"

This commit is contained in:
Emily Doherty 2025-11-04 22:05:53 -08:00
parent 6a4b1f117b
commit f18b129907

View File

@ -17,7 +17,7 @@ from interactions import (
EmbedField, EmbedField,
is_owner, is_owner,
check, check,
StringSelectOption, StringSelectOption, integration_types,
) )
from interactions import Task, IntervalTrigger from interactions import Task, IntervalTrigger
from interactions import slash_command, listen from interactions import slash_command, listen
@ -148,6 +148,7 @@ class Tracker(Extension):
name="register", name="register",
description="Register with a new GoblinBot Region for alerts on token price changes.", description="Register with a new GoblinBot Region for alerts on token price changes.",
) )
@integration_types(guild=True, user=True)
async def register(self, ctx: SlashContext): async def register(self, ctx: SlashContext):
text = ( text = (
"## Select a region to register with \n\n" "## Select a region to register with \n\n"
@ -163,6 +164,7 @@ class Tracker(Extension):
name="remove-registration", name="remove-registration",
description="Remove all alerts and registration from GoblinBot", description="Remove all alerts and registration from GoblinBot",
) )
@integration_types(guild=True, user=True)
async def remove_registration(self, ctx: SlashContext): async def remove_registration(self, ctx: SlashContext):
if await self._users.exists(ctx.user.id): if await self._users.exists(ctx.user.id):
user = await self._users.get(ctx.user.id) user = await self._users.get(ctx.user.id)
@ -173,16 +175,19 @@ class Tracker(Extension):
await ctx.send("All alert subscriptions and user data deleted", ephemeral=True) await ctx.send("All alert subscriptions and user data deleted", ephemeral=True)
@slash_command(description="The current retail token cost") @slash_command(description="The current retail token cost")
@integration_types(guild=True, user=True)
async def current(self, ctx: SlashContext): async def current(self, ctx: SlashContext):
current_str = await self.get_current_token(ctx, tdb.Flavor.RETAIL) current_str = await self.get_current_token(ctx, tdb.Flavor.RETAIL)
await ctx.send(current_str, ephemeral=True) await ctx.send(current_str, ephemeral=True)
@slash_command(description="The current classic token cost") @slash_command(description="The current classic token cost")
@integration_types(guild=True, user=True)
async def current_classic(self, ctx: SlashContext): async def current_classic(self, ctx: SlashContext):
current_str = await self.get_current_token(ctx, tdb.Flavor.CLASSIC) current_str = await self.get_current_token(ctx, tdb.Flavor.CLASSIC)
await ctx.send(current_str, ephemeral=True) await ctx.send(current_str, ephemeral=True)
@slash_command(name="add-alert", description="Add an alert listener") @slash_command(name="add-alert", description="Add an alert listener")
@integration_types(guild=True, user=True)
async def add_alert(self, ctx: SlashContext): async def add_alert(self, ctx: SlashContext):
if not await self._users.exists(ctx.user.id): if not await self._users.exists(ctx.user.id):
try: try:
@ -223,6 +228,7 @@ class Tracker(Extension):
@slash_command( @slash_command(
name="remove-alert", description="Remove an alert you have signed up for" name="remove-alert", description="Remove an alert you have signed up for"
) )
@integration_types(guild=True, user=True)
async def remove_alert(self, ctx: SlashContext): async def remove_alert(self, ctx: SlashContext):
if not await self._user_is_registered(ctx): if not await self._user_is_registered(ctx):
return return
@ -246,6 +252,7 @@ class Tracker(Extension):
@slash_command( @slash_command(
name="list-alerts", description="List all alerts you have signed up for" name="list-alerts", description="List all alerts you have signed up for"
) )
@integration_types(guild=True, user=True)
async def list_alerts(self, ctx: SlashContext): async def list_alerts(self, ctx: SlashContext):
if not await self._user_is_registered(ctx): if not await self._user_is_registered(ctx):
return return