This commit is contained in:
Ladislav Hano 2023-02-25 13:53:19 +01:00
parent 2cf15fbf2a
commit 6e385204d5
2 changed files with 5 additions and 80 deletions

View file

@ -1,80 +0,0 @@
const cubcommand =
{
name: 'add',
desc: 'Adds new event to the database',
options: [
{
type: 'str',
name: 'name',
desc: 'Name of the event you want to add',
req: true
}
]
}
new SlashCommandBuilder()
.setName('event')
.setDescription('Adds events to celebrate!')
.addSubcommand(subcommand =>
subcommand.setName('add')
.setDescription('Adds new event to the database')
.addStringOption(option => option.setName('name')
.setDescription('Name of the event you want to add')
.setRequired(true))
.addIntegerOption(option =>
option.setName('day')
.setDescription('Day of event')
.setRequired(true))
.addIntegerOption(option =>
option.setName('month')
.setDescription('Month of event')
.setRequired(true))
.addBooleanOption(option =>
option.setName('global')
.setDescription('Should this event display on all servers?'))
.addStringOption(option =>
option.setName('special-message')
.setDescription('Special message to send in event announcement')))
.addSubcommand(subcommand =>
subcommand.setName('delete')
.setDescription('Deletes event from database')
.addIntegerOption(option => option.setName('id')
.setDescription('Id of the even you want to change')
.setRequired(true)))
.addSubcommandGroup(subcommandGroup =>
subcommandGroup.setName('change')
.setDescription('Change the event entry')
.addSubcommand(subcommand =>
subcommand.setName('date')
.setDescription('Change date of an event')
.addIntegerOption(option =>
option.setName('day')
.setDescription('New event day')
.setRequired(true))
.addIntegerOption(option =>
option.setName('month')
.setDescription('New event month')
.setRequired(true))
.addIntegerOption(option => option.setName('id')
.setDescription('Id of the even you want to change')
.setRequired(true)))
.addSubcommand(subcommand =>
subcommand.setName('name')
.setDescription('Change name of an event')
.addStringOption(option =>
option.setName('new-name')
.setDescription('New name of the event')
.setRequired(true))
.addIntegerOption(option => option.setName('id')
.setDescription('Id of the even you want to change')
.setRequired(true)))
.addSubcommand(subcommand =>
subcommand.setName('special-message')
.setDescription('Change special message of an event')
.addStringOption(option =>
option.setName('new-message')
.setDescription('New special message')
.setRequired(true))))
.addSubcommand(subcommand =>
subcommand.setName('list')
.setDescription('List all events')),

View file

@ -1,4 +1,5 @@
const moove = require("./moove") const moove = require("./moove")
const help = require('./helpFunctions')
function gotMessage(message) { function gotMessage(message) {
if (message.author.bot) { if (message.author.bot) {
@ -14,8 +15,12 @@ function gotMessage(message) {
* that argument mentions channel * that argument mentions channel
*/ */
console.log(message.reference)
console.log(msgContentSplit.length)
console.log(message)
if (message.reference != null && msgContentSplit.length == 1 && if (message.reference != null && msgContentSplit.length == 1 &&
message.mentions.channels.first() != undefined) { message.mentions.channels.first() != undefined) {
console.log("aaaa")
moove(message, msgContentSplit[0]) moove(message, msgContentSplit[0])
} }