Ratelimit refreshes
Some checks failed
Build and Publish / build_and_publish (push) Has been cancelled

This commit is contained in:
Nexus 2024-07-05 00:51:52 +01:00
parent ee3c3df289
commit 5d6123dffc

View file

@ -180,6 +180,9 @@ class ElectionCog(commands.Cog):
@discord.ui.button(label="Refresh", style=discord.ButtonStyle.primary, emoji="\U0001f501")
async def refresh(_self, _btn, interaction):
await interaction.response.defer(invisible=True)
if interaction.message.edited_at:
if (discord.utils.utcnow() - interaction.message.edited_at).total_seconds() < 5:
return await interaction.followup.send("Slow down.", ephemeral=True)
try:
embed = await self._get_embed()
except Exception as e: