Archived
generated from imcompiling/discord-bot-template
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
build_develop / build (push) Successful in 22s
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user