Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -47,7 +47,8 @@ class DMButton(Button):
|
|
47 |
|
48 |
async def callback(self, interaction: discord.Interaction):
|
49 |
# await interaction.user.send(self.message) # this is for DMs, but users may have DMs disabled
|
50 |
-
|
|
|
51 |
unique_string = generate_unique_string()
|
52 |
user_tokens[self.user_id] = unique_string
|
53 |
unique_link = f"{GRADIO_APP_URL}?user_id={self.user_id}&token={unique_string}"
|
|
|
47 |
|
48 |
async def callback(self, interaction: discord.Interaction):
|
49 |
# await interaction.user.send(self.message) # this is for DMs, but users may have DMs disabled
|
50 |
+
if int(self.user_id) in user_tokens:
|
51 |
+
del user_tokens[int(self.user_id)] # always delete all past tokens when creating new link
|
52 |
unique_string = generate_unique_string()
|
53 |
user_tokens[self.user_id] = unique_string
|
54 |
unique_link = f"{GRADIO_APP_URL}?user_id={self.user_id}&token={unique_string}"
|