-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.ts.example
72 lines (64 loc) · 2.25 KB
/
command.ts.example
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { EmbedBuilder, ApplicationCommandType, ApplicationCommandOptionType, CommandInteraction, ColorResolvable } from 'discord.js'
import ss from '../../configs/settings'
const staffRoles:string[] = ["1216513737842757842"]
module.exports = {
name: "ping",
description: "Teste do cmd",
type: ApplicationCommandType.ChatInput,
default_member_permissions: 'ManageMessages',
userRoles: staffRoles,
cooldown: 5,
options: [
{
name: 'cor',
description: `Escolha uma cor`,
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{
name: `Vermelho`,
value: `vermelho`,
},
{
name: `Preto`,
value: `preto`,
},
{
name: `Verde`,
value: `verde`,
},
],
},
{
name: 'numero',
description: "Informe um numero",
type: ApplicationCommandOptionType.Number,
required: true,
},
{
name: 'user',
description: "Mencione alguém",
type: ApplicationCommandOptionType.User,
required: true,
},
{
name: 'canal',
description: "Informe um canal",
type: ApplicationCommandOptionType.Channel,
required: true,
},
],
run: async (client: any, interaction: any) => {
const cor = interaction.options.getString('cor')
const numero = interaction.options.getNumber('numero')
const user = interaction.options.getMember('user')
const canal = interaction.options.getChannel('canal')
interaction.reply({ content: `Cor selecionada: ${cor}\nNumero informado: ${numero}\nUsuario: ${user}\nCanal: ${canal}`, ephemeral: true})
let embed = new EmbedBuilder()
.setColor(ss.color as ColorResolvable)
.setDescription(`Cor selecionada: ${cor}\nNumero informado: ${numero}\nUsuario: ${user}\nCanal: ${canal}`)
.setTimestamp()
.setTitle("Embed exemplo")
return interaction.channel.send({ embeds: [embed]})
}
}