36 lines
843 B
TypeScript
36 lines
843 B
TypeScript
import { client } from '../..'
|
|
import { Command } from '../structures/command'
|
|
import { RunOptions } from '../types/commandTypes'
|
|
export default new Command({
|
|
name: 'list',
|
|
description: 'Lists upcoming events',
|
|
options: [
|
|
{
|
|
name: 'count',
|
|
description: 'The max amount of events to list',
|
|
type: 'INTEGER',
|
|
required: false,
|
|
minValue: 1,
|
|
maxValue: 100,
|
|
|
|
}
|
|
],
|
|
run: async (opt: RunOptions) => {
|
|
console.dir(opt)
|
|
const interactionGuild = opt.interaction.guild
|
|
const events = interactionGuild?.scheduledEvents.cache
|
|
let output = ''
|
|
if (!events?.values()) {
|
|
opt.interaction.followUp('No events to list')
|
|
return
|
|
}
|
|
const amount = 0
|
|
if (opt.interaction.options.get('count'))
|
|
for (const e of events.values()) {
|
|
output += e.toString()
|
|
output += `\n`
|
|
}
|
|
opt.interaction.followUp(output)
|
|
}
|
|
})
|