Skip to content

Commit

Permalink
disabled button for topic suggest reminder
Browse files Browse the repository at this point in the history
  • Loading branch information
arcinfini committed Jul 11, 2024
1 parent 4daf197 commit eaaa4cf
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion app/cogs/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import logging
import re
import typing
from random import randint
from typing import TYPE_CHECKING

import discord
Expand Down Expand Up @@ -247,7 +248,18 @@ async def topic(self, interaction: discord.Interaction):
Fetches a random topic.
"""
topic = next(self.topics_cycle)
await interaction.response.send_message(f"{topic}")
view = discord.utils.MISSING

if randint(0, 100) > 70: # roughly 30% chance
view = dui.View()
button = dui.Button(
disabled=True,
style=discord.ButtonStyle.gray,
label=f"Seeing duplicate topics? Suggest new ones with /{self.topic_suggest.qualified_name}!",
)
view.add_item(button)

await interaction.response.send_message(f"{topic}", view=view)

@topics_command.command()
@checks.mod_and_above()
Expand Down

0 comments on commit eaaa4cf

Please sign in to comment.