Removed unused commands
This commit is contained in:
@@ -1,66 +0,0 @@
|
||||
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { devMessage, embedColor } from "~/config/options"
|
||||
import { ICommand } from "~/typings"
|
||||
import ban from "./counting/ban"
|
||||
import unban from "./counting/unban"
|
||||
|
||||
export default {
|
||||
name: "counting",
|
||||
description: "counting subcommands",
|
||||
dev: false,
|
||||
public: true,
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("counting")
|
||||
.setDescription("counting subcommands")
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("ban")
|
||||
.setDescription("Ban a user from counting")
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to ban")
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("unban")
|
||||
.setDescription("Unban a user from counting")
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to ban")
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
if (subcommand === "ban") {
|
||||
ban(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "unban") {
|
||||
unban(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "This command is currently under development",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
} as ICommand
|
||||
@@ -1,36 +0,0 @@
|
||||
import { GuildMember, userMention } from "discord.js"
|
||||
import { devMessage, embedColor } from "~/config/options"
|
||||
import { countingBanned } from "~/config/roles"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
const member = interaction.options.getMember("user")! as GuildMember
|
||||
|
||||
if (member.roles.cache.has(countingBanned)) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: userMention(member.user.id) + " is currently banned from counting",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
})
|
||||
} else {
|
||||
await member.roles.add(countingBanned)
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: userMention(member.user.id) + " has been banned from counting",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,36 +0,0 @@
|
||||
import { GuildMember, userMention } from "discord.js"
|
||||
import { devMessage, embedColor } from "~/config/options"
|
||||
import { countingBanned } from "~/config/roles"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
const member = interaction.options.getMember("user")! as GuildMember
|
||||
|
||||
if (!member.roles.cache.has(countingBanned)) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: userMention(member.user.id) + " is currently not banned from counting",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
})
|
||||
} else {
|
||||
await member.roles.remove(countingBanned)
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: userMention(member.user.id) + " has been unbanned from counting",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,150 +0,0 @@
|
||||
import { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import { ICommand } from "~/typings"
|
||||
import leave from "./music/leave"
|
||||
import nowplaying from "./music/nowplaying"
|
||||
import pause from "./music/pause"
|
||||
import play from "./music/play"
|
||||
import queue from "./music/queue"
|
||||
import repeat from "./music/repeat"
|
||||
import skip from "./music/skip"
|
||||
import unpause from "./music/unpause"
|
||||
import volume from "./music/volume"
|
||||
|
||||
export default {
|
||||
name: "music",
|
||||
description: "Subcommands for music commands",
|
||||
dev: true,
|
||||
public: false,
|
||||
subcommands: true,
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("music")
|
||||
.setDescription("Subcommands for music commands")
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("play")
|
||||
.setDescription("Play a song")
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription("The song to play")
|
||||
.setAutocomplete(true)
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("volume")
|
||||
.setDescription("Change the volume of the music")
|
||||
.addNumberOption(option =>
|
||||
option
|
||||
.setName("volume")
|
||||
.setDescription("The volume to set")
|
||||
.setMinValue(1)
|
||||
.setMaxValue(100)
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("skip")
|
||||
.setDescription("Skip the current song")
|
||||
.addNumberOption(option =>
|
||||
option
|
||||
.setName("amount")
|
||||
.setDescription("The amount of songs to skip")
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("repeat")
|
||||
.setDescription("Set repeat mode")
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("mode")
|
||||
.setDescription("The repeat mode")
|
||||
.addChoices(
|
||||
{ name: "Off", value: "off" },
|
||||
{ name: "Track", value: "track" },
|
||||
{ name: "Queue", value: "queue" }
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("queue")
|
||||
.setDescription("Show the queue")
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("nowplaying")
|
||||
.setDescription("Show the currently playing song")
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("pause")
|
||||
.setDescription("Pause the music")
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("unpause")
|
||||
.setDescription("Unpause the music")
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("leave")
|
||||
.setDescription("Leave the voice channel")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setContexts(InteractionContextType.Guild),
|
||||
|
||||
async execute({ interaction }) {
|
||||
const subcommand = interaction.options.getSubcommand()
|
||||
|
||||
if (subcommand === "play") {
|
||||
play(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "volume") {
|
||||
volume(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "skip") {
|
||||
skip(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "repeat") {
|
||||
repeat(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "queue") {
|
||||
queue(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "nowplaying") {
|
||||
nowplaying(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "pause") {
|
||||
pause(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "unpause") {
|
||||
unpause(interaction)
|
||||
return
|
||||
}
|
||||
|
||||
if (subcommand === "leave") {
|
||||
leave(interaction)
|
||||
return
|
||||
}
|
||||
}
|
||||
} as ICommand
|
||||
@@ -1,27 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
if (!queue) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
queue.delete()
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "Left the voice channel",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,60 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const current = queue.currentTrack
|
||||
if (!current) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const progressBar = queue.node.createProgressBar({
|
||||
leftChar: "▬",
|
||||
rightChar: "▬",
|
||||
separator: "|",
|
||||
indicator: "🔘",
|
||||
timecodes: true,
|
||||
length: 15
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Now Playing",
|
||||
description: `
|
||||
[${current.title}](${current.url})
|
||||
|
||||
${progressBar}
|
||||
`.removeIndents(),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: current.thumbnail
|
||||
},
|
||||
footer: {
|
||||
text: `Requested by ${current.requestedBy!.username} | ${current.duration}`
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,40 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (queue.node.isPaused()) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "The music is already paused",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
queue.node.setPaused(true)
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Paused the music",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,53 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { GuildMember } from "discord.js"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
const query = interaction.options.getString("query")!
|
||||
const channel = (interaction.member as GuildMember).voice.channel
|
||||
const player = useMainPlayer()
|
||||
|
||||
if (!channel) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "You need to be in a voice channel to play music",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let replyMessage: string = ""
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
const { track } = await player.play(channel, query, {
|
||||
requestedBy: interaction.user,
|
||||
nodeOptions: {
|
||||
volume: 25
|
||||
}
|
||||
})
|
||||
|
||||
if (queue) {
|
||||
replyMessage = `Added [${track.title}](${track.url}) to the queue`
|
||||
} else {
|
||||
replyMessage = `Playing [${track.title}](${track.url})`
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: replyMessage,
|
||||
thumbnail: {
|
||||
url: track.thumbnail
|
||||
},
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: track.duration + " minutes",
|
||||
icon_url: interaction.user.avatarURL()!
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,41 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no queue",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const currentSong = queue.currentTrack
|
||||
const nowPlaying = `Now playing: [${currentSong?.title}](${currentSong?.url})`
|
||||
const tracks = queue.tracks.map((track, index) => {
|
||||
return `${index + 1}. [${track.title}](${track.url})`
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Queue",
|
||||
description: nowPlaying + "\n\n" + tracks.join("\n"),
|
||||
thumbnail: {
|
||||
url: currentSong?.thumbnail || ""
|
||||
},
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: `Total tracks: ${queue.tracks.size}`
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,40 +0,0 @@
|
||||
import { QueueRepeatMode, useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const QueueRepeatModes = {
|
||||
"off": QueueRepeatMode.OFF,
|
||||
"track": QueueRepeatMode.TRACK,
|
||||
"queue": QueueRepeatMode.QUEUE
|
||||
}
|
||||
|
||||
type RepeatMode = keyof typeof QueueRepeatModes
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const mode = interaction.options.getString("mode") as RepeatMode
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no queue",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
queue.setRepeatMode(QueueRepeatModes[mode])
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Repeat mode set to ${mode}`,
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,46 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const amount = interaction.options.getNumber("amount") ?? 1
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no queue",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (amount > queue.size) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `There are only ${queue.size} song${queue.size === 1 ? "" : "s"} in the queue`,
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (amount === 1) {
|
||||
queue.node.skip()
|
||||
} else {
|
||||
queue.node.skipTo(amount)
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Skipped ${amount === 1 ? "1 song" : `${amount} songs`}`,
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,40 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!queue.node.isPaused()) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "The music is not paused",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
queue.node.setPaused(false)
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Unpaused the music",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
@@ -1,31 +0,0 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { embedColor } from "~/config/options"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const volume = interaction.options.getNumber("volume")!
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
|
||||
if (!queue) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There is no music playing",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
queue.node.setVolume(volume)
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Volume set to ${volume}`,
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
Reference in New Issue
Block a user