From 80f405ba455c3d7ed97feb1717e3f851fb1658d1 Mon Sep 17 00:00:00 2001 From: ringoXD Date: Thu, 29 Feb 2024 19:10:15 +0900 Subject: [PATCH] uwu --- commands/receiveupdate.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/commands/receiveupdate.js b/commands/receiveupdate.js index 01a3813..0262270 100644 --- a/commands/receiveupdate.js +++ b/commands/receiveupdate.js @@ -1,4 +1,4 @@ -const { SlashCommandBuilder, ChannelType, PermissionsBitField } = require('discord.js'); +const { SlashCommandBuilder, ChannelType, PermissionsBitField, CommandInteraction } = require('discord.js'); const config = require('../config.json') const { LANG } = require('../util/languages'); @@ -13,19 +13,20 @@ module.exports = { .addChannelTypes(ChannelType.GuildText) .setRequired(true) ), - execute: async function (interaction, client) { + execute: async function (/** @type {CommandInteraction} */ interaction, client) { + await interaction.deferReply() if (!interaction.member.permissions.has(PermissionsBitField.Flags.Administrator)) { - return await interaction.reply('権限がありません!(管理者権限が必要です。)') + return await interaction.editReply('権限がありません!(管理者権限が必要です。)') } const targetchannel = interaction.options.getChannel('channel'); client.channels.resolve("1211695901760819281").addFollower(targetchannel.id) //TODO: config.jsonで編集可能に? .then(() => console.log(`[Sekai.Explode] new follower! ${interaction.guild.name} - ${interaction.guild.id}`), - interaction.reply(`<#${targetchannel.id}>にSekai.Explodeのアナウンスを通知します :wave:`) + interaction.editReply(`<#${targetchannel.id}>にSekai.Explodeのアナウンスを通知します :wave:`) ) .catch( - console.log(e), - interaction.reply(`失敗しました!エラー: ${e}`) + console.log(`Something Went wrong. ${e}`), + interaction.editReply(`失敗しました!エラー: ${e}`) ) } }; \ No newline at end of file