-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsendspecial.py
39 lines (29 loc) · 1.74 KB
/
sendspecial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import nextcord
from nextcord.ext import application_checks, commands
from project import CreateProjectView
from roles import ModifyRolesView
from tickets import CreateTicketView
from utils import normal_embed
from variables import guild_ids
async def send_create_project(channel):
await channel.send(embed=normal_embed("Pour créer un salon pour votre projet, veuillez cliquer sur ce bouton ou utilisez la commande `/project create`.\n\
Vous pouvez ensuite le modifier avec la commande `/project edit`", "Créer un projet"), view=CreateProjectView())
async def send_create_ticket(channel):
await channel.send(embed=normal_embed("Pour ouvrir un ticket, utilisez le sélecteur ci-dessous ou exécutez la commande `/ticket create`", "Ouvrir un ticket"),
view=CreateTicketView())
async def send_select_roles(channel):
await channel.send(embed=normal_embed("Appuyez sur un bouton ci-dessous pour sélectionner vos rôles de Langages ou vos rôles de Notification", "Sélectionnez vos rôles"),
view=ModifyRolesView())
class SendSpecialCog(commands.Cog):
commands_map = {
"create project": send_create_project,
"create ticket": send_create_ticket,
"select roles": send_select_roles
}
@nextcord.slash_command(name="send-special", description="Permet d'envoyer un message spécial", guild_ids=guild_ids,
default_member_permissions=nextcord.Permissions(administrator=True))
@application_checks.has_permissions(administrator=True)
async def send_special_cmd(self, interaction,
message: str = nextcord.SlashOption(name="message", description="Le message à envoyer", required=True, choices=commands_map.keys())):
await self.commands_map[message](interaction.channel)
await interaction.response.send_message("Le message a été envoyé", ephemeral=True)