mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 06:33:18 +00:00
Making interaction.options nullable in play.js
This commit is contained in:
parent
b5d5ca1fe6
commit
277b67e3df
@ -17,7 +17,7 @@ module.exports = {
|
|||||||
category: "radio",
|
category: "radio",
|
||||||
async execute(interaction, client, Discord, command) {
|
async execute(interaction, client, Discord, command) {
|
||||||
let message = {};
|
let message = {};
|
||||||
let query = interaction.options.getString("query");
|
let query = interaction.options?.getString("query");
|
||||||
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
let url = query ? query.replace(/<(.+)>/g, "$1") : "";
|
||||||
const radio = client.radio.get(interaction.guild.id);
|
const radio = client.radio.get(interaction.guild.id);
|
||||||
const voiceChannel = interaction.member.voice.channel;
|
const voiceChannel = interaction.member.voice.channel;
|
||||||
@ -182,7 +182,6 @@ async function play(interaction, guild, client, url, Discord) {
|
|||||||
.setCustomId('list')
|
.setCustomId('list')
|
||||||
.setEmoji(client.messageEmojis["list"])
|
.setEmoji(client.messageEmojis["list"])
|
||||||
.setStyle('PRIMARY')
|
.setStyle('PRIMARY')
|
||||||
.setDisabled(true)
|
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new Discord.MessageButton()
|
new Discord.MessageButton()
|
||||||
@ -193,10 +192,9 @@ async function play(interaction, guild, client, url, Discord) {
|
|||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new Discord.MessageButton()
|
new Discord.MessageButton()
|
||||||
.setCustomId('play')
|
.setCustomId('stop')
|
||||||
.setEmoji(client.messageEmojis["stop"])
|
.setEmoji(client.messageEmojis["stop"])
|
||||||
.setStyle('PRIMARY')
|
.setStyle('PRIMARY')
|
||||||
.setDisabled(true)
|
|
||||||
)
|
)
|
||||||
.addComponents(
|
.addComponents(
|
||||||
new Discord.MessageButton()
|
new Discord.MessageButton()
|
||||||
@ -210,7 +208,6 @@ async function play(interaction, guild, client, url, Discord) {
|
|||||||
.setCustomId('statistics')
|
.setCustomId('statistics')
|
||||||
.setEmoji(client.messageEmojis["statistics"])
|
.setEmoji(client.messageEmojis["statistics"])
|
||||||
.setStyle('PRIMARY')
|
.setStyle('PRIMARY')
|
||||||
.setDisabled(true)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if(!radio.message){
|
if(!radio.message){
|
||||||
|
Loading…
Reference in New Issue
Block a user