|
1 | 1 | import {
|
2 |
| - Client, |
3 |
| - BaseCommandInteraction, |
4 |
| - MessageButton, |
5 |
| - MessageActionRow, |
| 2 | + Client, |
| 3 | + BaseCommandInteraction, |
| 4 | + MessageButton, |
| 5 | + MessageActionRow, |
6 | 6 | } from "discord.js";
|
7 | 7 | import { Command } from "../interface";
|
8 | 8 |
|
9 | 9 | const cmd: Command = {
|
10 |
| - data: { |
11 |
| - name: "setup", |
12 |
| - description: "Discord hCaptch認証のセットアップをします", |
13 |
| - defaultMemberPermissions: ["ADMINISTRATOR"], |
14 |
| - }, |
15 |
| - async execute(client: Client, interaction: BaseCommandInteraction) { |
16 |
| - const guild = interaction.guild; |
17 |
| - await interaction.reply({ |
18 |
| - content: "セットアップを開始します", |
19 |
| - ephemeral: true, |
20 |
| - }); |
21 |
| - const role = guild?.roles.cache.find((role) => role.name === "verified"); |
22 |
| - if (!role === undefined) { |
| 10 | + data: { |
| 11 | + name: "setup", |
| 12 | + description: "Discord hCaptch認証のセットアップをします", |
| 13 | + defaultMemberPermissions: ["ADMINISTRATOR"], |
| 14 | + }, |
| 15 | + async execute(client: Client, interaction: BaseCommandInteraction) { |
| 16 | + const guild = interaction.guild; |
| 17 | + await interaction.reply({ |
| 18 | + content: "セットアップを開始します", |
| 19 | + ephemeral: true, |
| 20 | + }); |
| 21 | + const role = guild?.roles.cache.find((role) => role.name === "verified"); |
| 22 | + if (!role === void 0) { |
| 23 | + await interaction.editReply({ |
| 24 | + content: |
| 25 | + "Verifiedロールが存在します\n認証ボタンを作成する場合は`/genbutton`コマンドを実行してください", |
| 26 | + }); |
| 27 | + return; |
| 28 | + } |
| 29 | + guild?.roles.create({ name: "verified" }); |
23 | 30 | await interaction.editReply({
|
24 |
| - content: |
25 |
| - "Verifiedロールが存在します\n認証ボタンを作成する場合は`/genbutton`コマンドを実行してください", |
| 31 | + content: "ロールを作成しました", |
| 32 | + }); |
| 33 | + const button = new MessageButton() |
| 34 | + .setCustomId("verify") |
| 35 | + .setStyle("PRIMARY") |
| 36 | + .setLabel("認証") |
| 37 | + .setEmoji("✅"); |
| 38 | + await interaction.channel?.send({ |
| 39 | + embeds: [ |
| 40 | + { |
| 41 | + title: "認証方法", |
| 42 | + description: "認証を行うには、以下のボタンを押してください", |
| 43 | + color: "RANDOM", |
| 44 | + timestamp: new Date(), |
| 45 | + footer: { |
| 46 | + text: "©️ HidemaruOwO | Discord hCaptcha", |
| 47 | + }, |
| 48 | + }, |
| 49 | + ], |
| 50 | + components: [new MessageActionRow().addComponents(button)], |
26 | 51 | });
|
27 |
| - return; |
28 |
| - } |
29 |
| - guild?.roles.create({ name: "verified" }); |
30 |
| - await interaction.editReply({ |
31 |
| - content: "ロールを作成しました", |
32 |
| - }); |
33 |
| - const button = new MessageButton() |
34 |
| - .setCustomId("verify") |
35 |
| - .setStyle("PRIMARY") |
36 |
| - .setLabel("認証") |
37 |
| - .setEmoji("✅"); |
38 |
| - await interaction.channel?.send({ |
39 |
| - embeds: [ |
40 |
| - { |
41 |
| - title: "認証方法", |
42 |
| - description: "認証を行うには、以下のボタンを押してください", |
43 |
| - color: "RANDOM", |
44 |
| - timestamp: new Date(), |
45 |
| - footer: { |
46 |
| - text: "©️ HidemaruOwO | Discord hCaptcha", |
47 |
| - }, |
48 |
| - }, |
49 |
| - ], |
50 |
| - components: [new MessageActionRow().addComponents(button)], |
51 |
| - }); |
52 |
| - await interaction.editReply({ content: "セットアップを完了しました" }); |
53 |
| - }, |
| 52 | + await interaction.editReply({ content: "セットアップを完了しました" }); |
| 53 | + }, |
54 | 54 | };
|
55 | 55 |
|
56 | 56 | export { cmd };
|
0 commit comments