Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
uwu
Browse files Browse the repository at this point in the history
  • Loading branch information
ringo360 committed Feb 29, 2024
1 parent 6af643e commit 80f405b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions commands/receiveupdate.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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}`)
)
}
};

0 comments on commit 80f405b

Please sign in to comment.