Added types for subcommands
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function leave(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
if (!queue) {
|
||||
@@ -23,3 +23,5 @@ export default async function leave(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function nowplaying(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
@@ -56,3 +56,5 @@ export default async function nowplaying(interaction: ChatInputCommandInteractio
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function pause(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
@@ -36,3 +36,5 @@ export default async function pause(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction, GuildMember } from "discord.js"
|
||||
import { GuildMember } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function play(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
const query = interaction.options.getString("query")!
|
||||
const channel = (interaction.member as GuildMember).voice.channel
|
||||
@@ -41,3 +42,5 @@ export default async function play(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function queue(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
const player = useMainPlayer()
|
||||
const queue = player.queues.get(interaction.guildId!)
|
||||
@@ -37,3 +37,5 @@ export default async function queue(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function skip(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const amount = interaction.options.getNumber("amount") ?? 1
|
||||
@@ -42,3 +42,5 @@ export default async function skip(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function pause(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const player = useMainPlayer()
|
||||
@@ -36,3 +36,5 @@ export default async function pause(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useMainPlayer } from "discord-player"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { embedColor } from "~/config/options.js"
|
||||
import { SubCommand } from "~/typings"
|
||||
|
||||
export default async function volume(interaction: ChatInputCommandInteraction) {
|
||||
const cmd: SubCommand = async (interaction) => {
|
||||
await interaction.deferReply()
|
||||
|
||||
const volume = interaction.options.getNumber("volume")!
|
||||
@@ -27,3 +27,5 @@ export default async function volume(interaction: ChatInputCommandInteraction) {
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
export default cmd
|
||||
|
||||
Reference in New Issue
Block a user