diff --git a/src/cogs/ollama.py b/src/cogs/ollama.py index 2263b26..6382f06 100644 --- a/src/cogs/ollama.py +++ b/src/cogs/ollama.py @@ -6,6 +6,8 @@ import textwrap import time import typing import io + +from discord import from discord.ui import View, button from fnmatch import fnmatch @@ -21,6 +23,9 @@ class OllamaView(View): self.ctx = ctx self.cancel = asyncio.Event() + async def interaction_check(self, interaction: discord.Interaction) -> bool: + return interaction.user == self.ctx.user + @button(label="Stop", style=discord.ButtonStyle.danger, emoji="\N{wastebasket}\U0000fe0f") async def _stop(self, btn: discord.ui.Button, interaction: discord.Interaction): self.cancel.set()