oops haha
This commit is contained in:
parent
ad92744808
commit
8d5cd12a45
7 changed files with 2 additions and 14 deletions
|
@ -3,8 +3,6 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class LoopCommand extends MusicCommand {
|
class LoopCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
|
|
|
@ -4,8 +4,6 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class NowPlayingCommand extends MusicCommand {
|
class NowPlayingCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
|
|
|
@ -2,8 +2,6 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class PauseCommand extends MusicCommand {
|
class PauseCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
|
|
|
@ -5,8 +5,6 @@ const searchRegex = /^ytsearch:/;
|
||||||
|
|
||||||
class PlayCommand extends MusicCommand {
|
class PlayCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.args[0]) return "You need to provide what you want to play!";
|
if (!this.args[0]) return "You need to provide what you want to play!";
|
||||||
const query = this.args.join(" ").trim();
|
const query = this.args.join(" ").trim();
|
||||||
const search = urlRegex.test(query) ? query : (searchRegex.test(query) ? query : `ytsearch:${query}`);
|
const search = urlRegex.test(query) ? query : (searchRegex.test(query) ? query : `ytsearch:${query}`);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import { queues } from "../../utils/soundplayer.js";
|
import { queues } from "../../utils/soundplayer.js";
|
||||||
|
//import { Rest } from "lavacord";
|
||||||
import fetch from "node-fetch";
|
import fetch from "node-fetch";
|
||||||
import format from "format-duration";
|
import format from "format-duration";
|
||||||
import paginator from "../../utils/pagination/pagination.js";
|
import paginator from "../../utils/pagination/pagination.js";
|
||||||
|
@ -6,14 +7,13 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class QueueCommand extends MusicCommand {
|
class QueueCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
if (!this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
if (!this.message.channel.permissionsOf(this.client.user.id).has("embedLinks")) return "I don't have the `Embed Links` permission!";
|
||||||
const queue = queues.get(this.message.channel.guild.id);
|
const queue = queues.get(this.message.channel.guild.id);
|
||||||
const player = this.connection;
|
const player = this.connection;
|
||||||
|
//const tracks = await Rest.decode(player.player.node, queue);
|
||||||
const tracks = await fetch(`http://${player.player.node.host}:${player.player.node.port}/decodetracks`, { method: "POST", body: JSON.stringify(queue), headers: { Authorization: player.player.node.password, "Content-Type": "application/json" } }).then(res => res.json());
|
const tracks = await fetch(`http://${player.player.node.host}:${player.player.node.port}/decodetracks`, { method: "POST", body: JSON.stringify(queue), headers: { Authorization: player.player.node.password, "Content-Type": "application/json" } }).then(res => res.json());
|
||||||
const trackList = [];
|
const trackList = [];
|
||||||
const firstTrack = tracks.shift();
|
const firstTrack = tracks.shift();
|
||||||
|
|
|
@ -3,8 +3,6 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class SkipCommand extends MusicCommand {
|
class SkipCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
|
|
|
@ -3,8 +3,6 @@ import MusicCommand from "../../classes/musicCommand.js";
|
||||||
|
|
||||||
class StopCommand extends MusicCommand {
|
class StopCommand extends MusicCommand {
|
||||||
async run() {
|
async run() {
|
||||||
if (process.env.NODE_ENV === "production" && this.message.author.id !== process.env.OWNER) return "Music commands are coming soon, but they aren't ready yet. Stay tuned to @esmBot_ on Twitter for updates!";
|
|
||||||
|
|
||||||
if (!this.message.channel.guild) return "This command only works in servers!";
|
if (!this.message.channel.guild) return "This command only works in servers!";
|
||||||
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
if (!this.message.member.voiceState.channelID) return "You need to be in a voice channel first!";
|
||||||
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
if (!this.message.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!";
|
||||||
|
|
Loading…
Reference in a new issue