mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-22 20:53:17 +00:00
Remove ts-ignore and fix usage reason
This commit is contained in:
parent
6de5e69dc0
commit
64f53c38d7
@ -1,17 +1,18 @@
|
||||
import { Interaction, PermissionFlagsBits } from "discord.js";
|
||||
import { ChannelType, Interaction, PermissionFlagsBits } from "discord.js";
|
||||
import RadioClient from "../../Client";
|
||||
|
||||
export default function interactionCreate(client: RadioClient, interaction: Interaction) {
|
||||
if(!(interaction.isButton()) && !(interaction.isChatInputCommand()) && !(interaction.isStringSelectMenu())) return;
|
||||
|
||||
//@ts-ignore
|
||||
const permissions = interaction.channel?.permissionsFor(interaction.client.user);
|
||||
if (!permissions.has(PermissionFlagsBits.ViewChannel)) return;
|
||||
if(interaction.channel?.type != ChannelType.DM){
|
||||
const permissions = interaction.channel?.permissionsFor(interaction.client.user);
|
||||
if (!permissions?.has(PermissionFlagsBits.ViewChannel)) return;
|
||||
|
||||
if (!permissions.has(PermissionFlagsBits.EmbedLinks)) return interaction.reply({
|
||||
content: client.messages.emojis["error"] + client.messages.noPermsEmbed,
|
||||
ephemeral: true
|
||||
});
|
||||
if (!permissions?.has(PermissionFlagsBits.EmbedLinks)) return interaction.reply({
|
||||
content: client.messages.emojis["error"] + client.messages.noPermsEmbed,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
|
||||
if(interaction.isChatInputCommand()){
|
||||
const commandName = interaction.commandName;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ButtonInteraction, ChatInputCommandInteraction, StringSelectMenuInteraction } from "discord.js";
|
||||
import { ButtonInteraction, ChatInputCommandInteraction, GuildMember, StringSelectMenuInteraction } from "discord.js";
|
||||
import RadioClient from "../../Client";
|
||||
import { command } from "../commands";
|
||||
|
||||
@ -21,8 +21,8 @@ export default function check(client: RadioClient, interaction: ButtonInteractio
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//@ts-ignore
|
||||
if (interaction.member.voice.channel !== radio.voiceChannel) {
|
||||
|
||||
if (interaction.member instanceof GuildMember && interaction.member?.voice.channel !== radio.voiceChannel) {
|
||||
interaction.reply({
|
||||
content: client.messages.emojis["error"] + client.messages.wrongVoiceChannel,
|
||||
ephemeral: true
|
||||
|
Loading…
Reference in New Issue
Block a user