fix say command perms

This commit is contained in:
Ryan Cao 2022-08-29 12:15:53 +08:00
parent d16bec1336
commit d1377b538d
No known key found for this signature in database
GPG key ID: 528A2C1B6656B97F
2 changed files with 4 additions and 2 deletions

View file

@ -1,4 +1,4 @@
import { SlashCommandBuilder, Routes } from 'discord.js';
import { SlashCommandBuilder, Routes, PermissionFlagsBits } from 'discord.js';
import { REST } from '@discordjs/rest';
import { getTags } from './tagsTags';
@ -44,7 +44,8 @@ import 'dotenv/config';
.setName('content')
.setDescription('Just content?')
.setRequired(true)
),
)
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers),
].map((command) => command.toJSON());
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);

View file

@ -112,6 +112,7 @@ client.on('interactionCreate', async (interaction) => {
);
} else if (commandName === 'say') {
if (!interaction.channel) return;
await interaction.deferReply();
await interaction.channel.send(interaction.options.getString('content')!);
await interaction.editReply('I said what you said!');