implement auto repeating events
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
mightypanders
2022-04-12 22:39:47 +02:00
parent 10bc4ae5df
commit 9df18575fd
10 changed files with 211 additions and 10 deletions

18
server/commands/echo.ts Normal file
View File

@ -0,0 +1,18 @@
import { Command } from '../structures/command'
import { RunOptions } from '../types/commandTypes'
export default new Command({
name: 'echo',
description: 'Echoes a text',
options: [
{
name: 'echo',
description: 'The text to echo',
type: 'STRING',
required: true
}
],
run: async (interaction: RunOptions) => {
console.log('echo called')
interaction.interaction.reply(interaction.toString())
}
})

View File

@ -1,8 +1,35 @@
import { client } from '../..'
import { Command } from '../structures/command'
import { RunOptions } from '../types/commandTypes'
export default new Command({
name: 'list',
description: 'Lists upcoming events',
run: async ({ interaction }) => {
interaction.reply('Hello')
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)
}
})