Ratelimit refreshes
Some checks failed
Build and Publish / build_and_publish (push) Has been cancelled
Some checks failed
Build and Publish / build_and_publish (push) Has been cancelled
This commit is contained in:
parent
ee3c3df289
commit
5d6123dffc
1 changed files with 3 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue