implement auto repeating events
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
18
server/commands/echo.ts
Normal file
18
server/commands/echo.ts
Normal 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())
|
||||
}
|
||||
})
|
@ -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)
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user