Add function to open raid buttons. Load the view in app so that views function after bot restart.
build_develop / build (push) Successful in 22s

This commit is contained in:
2025-03-19 19:16:17 -04:00
parent 10e561b0e3
commit 8d65d478cd
4 changed files with 115 additions and 10 deletions
+4 -2
View File
@@ -3,7 +3,7 @@
import nextcord
from nextcord.ext import application_checks, commands
from off_cooldown_bot.open_raid import OpenRaid
from off_cooldown_bot.open_raid import OpenRaid, build_raid_embed
from off_cooldown_bot.utils import GUILDS
ME = 206602713511886849
@@ -13,6 +13,8 @@ def is_me(): # noqa: ANN201
"""Predicate that makes sure only I can run the test commands."""
def predicate(interaction: nextcord.Interaction) -> bool:
if interaction.user is None:
return False
return interaction.user.id == ME
return application_checks.check(predicate)
@@ -38,4 +40,4 @@ class TestCog(commands.Cog, name="Test commands."):
interaction (nextcord.Interaction): Interaction with the message.
"""
await interaction.response.send_message("Starting an open raid.", view=OpenRaid())
await interaction.response.send_message("Starting an open raid.", embed=build_raid_embed(), view=OpenRaid())